[xml] Array definition in XML?

In XML, how do I declare array of integers?

I can declare it as the following:

<numbers type="array">

but may be there's simpler way like this?

<numbers [3,2,1]></numbers>

This question is related to xml arrays

The answer is

As its name is "numbers" it is clear it is a list of number... So an array of number... no need of the attribute type... Although I like the principle of specifying the type of field in a type attribute...

Once I've seen such an interesting construction:

<Ids xmlns:id="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

No, there is no simpler way. You only can lose the type=array.


In XML values in text() nodes.

If we write this


in element "numbers" will be one text() node with value "1,2,3".

Native way to get many text() nodes in element is insert nodes of other types in text.

Other available types is element or comment() node.

Split with element node:


Split with comment() node:


We can select this values by this XPath


Select value by index


Will return text() node with value "1"