[Solved] @ in XML tag name


You should not use values in XML tags. The correct way would be:

<?xml version="1.0"?>
<DS>
    <userdetails>
        <name>remrem</name>
        <email>[email protected]</email>
        <datetime>2014-09-23 07:41:57</datetime>
        <lang>fr</lang>
    </userdetails>
    <userdetails>
        <name>remrem</name>
        <email>[email protected]</email>
        <datetime>2014-09-23 07:41:57</datetime>
        <lang>fr</lang>
    </userdetails>
</DS>

There are only five special characters in XML: &lt; (<), &amp; (&), &gt; (>), &quot; (“), and &apos; (‘). However, tag names have more restrictions. A tag name is a token beginning with a letter or one of a few punctuation characters, and continuing with letters, digits, hyphens, underscores, colons, or full stops, together known as name characters. Or more precise:

NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
Name ::= (Letter | '_' | ':') (NameChar)*

It can get quite complicated, but for simplicity just stick to what you know from HTML and almost any programming language using variable names.

Use tags only to identify the type of content they hold.

2

solved @ in XML tag name