So I have a multidimensional array that looks like this:
var map = [[0, 0, 0, 0, 0, 0, 0],
[0, 3, 0, 0, 2, 0, 0],
[0, 0, 0, 0, 4, 0, 4],
[0, 0, 0, 0, 5, 0, 5],
[0, 0, 0, 0, 0, 0, 1],
[0, 0, 2, 5, 0, 0, 0],
[0, 0, 0, 2, 0, 0, 0],
[0, 4, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]];
And i would like to save it into my XML file.
My XML file looks like the following:
<TileMaps>
<Level> <!-- Level 1 -->
<map>[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 3, 2, 4, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]</map>
</Level>
<Level> <!-- Level 2 -->
<map>[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 3, 2, 4, 0, 0, 0, 0, 0, 1],
[1, 0, 2, 4, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]</map>
</Level>
</TileMaps>
So when i add the array i would like it to be placed within the XML file within the:
<Level><map> ARRAY HERE </map></Level>
Thanks