callum
callum

Reputation: 1

XML element with an index?

What I want to do is basically have my XML look like this:

<root>
  <Map1>  </Map1>
  <Map2>  </Map2> 
  <Map3>  </Map3>
</root>

I don't want to have to declare a new variable every time I want a new map, so how would I create an index at the end of my variable?

Upvotes: 0

Views: 96

Answers (1)

Max Fichtelmann
Max Fichtelmann

Reputation: 3504

You could add an index attribute, so your xml becomes:

<root>
  <Map index="1" />
  <Map index="2" />
  <Map index="3" />
</root>

Upvotes: 1

Related Questions