1

I wanted to know if codesynthesis-xsd can be used to modify values of an xml. From the website I could see only about xml parsing. But in my program I want to do both parsing as well as editing the xml.

Vishal Sharma
  • 1,670
  • 20
  • 55

1 Answers1

1

Yes, it is possible to

  • first parse the XML into the generated data object model
  • then make a modification
  • and finally serialize it back to XML

See for instance the library example in the CodeSynthesis XSD source package:

Erik Sjölund
  • 10,690
  • 7
  • 46
  • 74
  • Thanks for your response. I'll check the link. One more thing I wanted was schema validation of the xml. Is this also possible? – Vishal Sharma Jul 20 '19 at 16:36
  • Yes, validating with a schema is possible. See https://stackoverflow.com/questions/52275608/xerces-c-validate-xml-with-hardcoded-xsd/52464355#52464355 – Erik Sjölund Jul 20 '19 at 16:41
  • Thanks. One last related doubt. Codesynthesis-xsd is built on top of xerces, right? Actually I found about xerces first and then found xsd and I know there's some relation. But the documentation and the examples are a bit too much heavy for me in the beginning. – Vishal Sharma Jul 20 '19 at 16:46
  • I imagine xsd to be a library which makes working with xerces a bit easier. I think after paying some more attention to the examples and the documentation I'll get a better idea. – Vishal Sharma Jul 20 '19 at 16:48
  • 1
    Yes, __CodeSynthesis XSD__ makes use of __Xerces-C__ and yes working with __CodeSynthesis XSD__ together with __Xerces-C__ is easier and more convenient than working with only __Xerces-C__ . – Erik Sjölund Jul 20 '19 at 16:53