<?xml version="1.0" ?>
<accounts>
<1167/>
<1328/>
<1505/>
<1536 default="true" />
<1966/>
</accounts>
When I pass in the above XML at http://www.w3schools.com/XML/xml_validator.asp I get an error stating the line with <1167/> is invalid. I looked at the w3 description for elements, and didn't see any reason why it should be wrong. I'm sure its a simple mistake so would appreciate any help.
Thanks
The name of an element must not start with a digit¹.
Also, the name of an element should describe the "class" or "type" of the represented entity, and be static. Might I suggest:
<accounts>
<account number="1167"/>
<account number="1328"/>
<account number="1505"/>
<account number="1536" default="true" />
<account number="1966"/>
</accounts>
¹ For some reason, many answers here link to w3schools (which is not affiliated with the W3C). Instead, you should only trust the XML standard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With