I am using java to create a root element the string resolves as shown below.
Element root = doc.createElement("$XYZ");
i get and exception
org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElement(Core开发者_运维百科DocumentImpl.java:618)
any advice on how do i create the element?
The '$' symbol is not allowed in the xml, therefore you are getting your exception.
'XYZ' would be allowed, but '$XYZ' is not allowed as it contains the '$'
You can see the w3 spec on the starting character here
精彩评论