XML element and attribute names

Can XML , XML , XML or any change in the uppercase and lowercase "xml" be used as element names or attributes in XML ?

If not, why?

Edit1

I mean elements or naming attributes. Not doctype

Edit2

I do not propose that this be a good name for an element or attribute, I could not find a definitive answer for this.

+4
source share
3 answers

Although most tools probably do not interfere with this, it is probably bad practice. According to http://www.w3.org/TR/xml/#NT-Name

Names starting with the string "xml" or with any string that matches (('X' | 'x') ('M' | 'm') ('L' | 'l')) are reserved for standardization in this or future versions of this specification.

those. Now it can work ...

+5
source

Although not prohibited, see Suggestions for XML Names ( Non -Normative) :

Names that are meaningless, unpronounceable, difficult to read, or easy confusion with other names should not be used .

+5
source

Defining the XML format does not prohibit: http://www.w3.org/TR/xml/#NT-Name

You can check it here: http://www.w3schools.com/xml/xml_validator.asp - even the "xml" tags are checked without errors.

+4
source

Source: https://habr.com/ru/post/1497411/


All Articles