Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write a comment in XSD that will appear in auto-generated XML?

How can I write a comment in XML schema as below and that needs to be displayed in XML when we generate XML from XML Schema using Oxygen XML editor.

< THIS is a request for BUSINESS >

Above is displayed in comment tag

like image 538
srinathshil Avatar asked Oct 17 '25 08:10

srinathshil


1 Answers

Note first that your requested "comment" should instead be

<!-- < THIS is a request for BUSINESS > -->

as the form you request would not be allowed in XML (but perhaps that was what you intended anyway when you mentioned that the "above is displayed in comment tag").

The purpose of an XSD is to validate an XML document. While tools can, and have, been written to generate a valid XML document from an XSD, there is no reason to expect such tools to pass comments or annotations through to the XML documents they create.

Consider instead an XSLT script to augment the generated XML with the additional comments you wish to add.

like image 191
kjhughes Avatar answered Oct 19 '25 15:10

kjhughes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!