Xedni
Xedni

Reputation: 4695

Square brackets in XML Element Name

Is it possible to use square brackets in an XML element's name?

for instance:

<root>
    <Data.Entity.Result[0]>Hello</Data.Entity.Result[0]>
</root>

I tried using escape characters like...

    &lsqb; 
    &lbrack;
    &#91;

...and so forth, but I still get validation errors.

Upvotes: 1

Views: 3208

Answers (1)

Daniel Haley
Daniel Haley

Reputation: 52878

No you can't use square brackets (or entity references) in element names.

See http://www.w3.org/TR/REC-xml/#sec-common-syn (especially the "Names and Tokens" section).

Upvotes: 2

Related Questions