问题
Can i create an element with forward slash as part of the name?
<Data>
<DataRow>
<Orange/Apple> fruit </Orange/Apple>
</DataRow>
</Data>
seems invalid to me but just want to confirm.
回答1:
Can i create an element with forward slash as part of the name?
No, according to the grammar pulished on the W3.org website it is not a valid character in a name.
hexadecimal value 0x20 cannot be included in a name
0x20 is the space character and you will see that it is not on the list of valid NameChars. It is considered whitespace unless it is part of a value.
来源:https://stackoverflow.com/questions/15000160/can-i-create-an-element-with-forward-slash-as-part-of-the-name