Avatar of kalyangkm
kalyangkm
Flag for United States of America asked on

How to handle reserved words in XSD

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.

<Soapenv:Body>
     <xyz:Starting>
         <xyz:xmlDocument>
                    <messageHeader>
                            <A>222</A>
                            <B>2233</B>
                                .....
                             ..........
                              .......
XMLProgramming

Avatar of undefined
Last Comment
Gertone (Geert Bormans)

8/22/2022 - Mon
Gertone (Geert Bormans)

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
kalyangkm

ASKER
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.
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck