How to handle reserved words in XSD

kalyangkm used Ask the Experts™
I have a scenario where in the the XSD looks like the following after converting the XML to XSD. When I remove xml part from xmlDocument, the XSD works but if I keep it as xmlDocument it has issues. Please let me how to handle this.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gertone (Geert Bormans)Information Architect
Top Expert 2006

the XML recommendation states that names for elements schould not start with "xml" (or uppercase variants) for "future standardisation" reasons

By now it is fairly clear there will not be an XML 2.0 or the acceptance of XML 1.1, so most tools are very lax with this requirement
Some tools however will not allow you to do so.
So, this is likely a limitation by your tool being too strict (or actually adhering strict to the recommendation)

I consider element names that start with "xml" as poor design and I strongly recommend not to do that. Simply because by XML 1.0 recommendation you should not and you might hit a tool that prevents you (as you just seem to have experienced)

So, change the name of your element. If you can't do that, tell us which tool is breaking on it, we might find a workaround or suggest alternative tooling


We are using SAP PO middleware and looks like its not xml 1.1 + capable from what you are saying. Please let me know if there is any alternative.
Information Architect
Top Expert 2006
I might not have made myself clear enough. There is only one XML recommendation (1.0) All other versions have never made it to recommendation stage, if the effort started at all.
The XML recommendation recommends not to use "xml" as the first three letters of an element name.
But it does not enforce that rule in any way, except through a warning that future releases of the XML recommendation might be more strict.
The committee imagined reserved names similar to how they also have xml:id and xml:lang attributes reserved.
Some parser implementers decided to already be strict regarding names early on.
That is why I recommend that you avoid "xmlDocument" and the like in your schema.
Because if it does not break your own tooling, it might break someone elses tooling.
As XML was meant to be an open standard for information exchange, you should not limit its use by choosing names that can break a toolset somewhere

As per recommending an alternative tooling... SAP PO is a middleware platform. I assume you have a bunch of code developed against it... it is not like swapping an editor or a parser.
Stick to the platform and change the element name would be my suggestion

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial