tags:

views:

136

answers:

3

can we use a number as text node in XML file? for example

<2>
 <abi>Zen</abi>
</2>

it is giving the error as follows

+6  A: 

XML elements must follow these naming rules:

* Names can contain letters, numbers, and other characters
* Names cannot start with a number or punctuation character
* Names cannot start with the letters xml (or XML, or Xml, etc)
* Names cannot contain spaces

http://www.w3schools.com/xml/xml_elements.asp

Shoban
Thank you so much for your information.
If this answer helped. You can mark it as accepted answer :)
Shoban
+1  A: 
ax
A: 

Short answer: No.

You could use something like this, though

<element2>
  <abi>Zen</abi>
</element2>

But this would make for a really ugly XML schema, where you would ultimately be limited to a maximum number of elements.

I think you should go with somethink like this:

<element number="2">
  <abi>Zen</abi>
</element>
Jan Aagaard