logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: How to parse XSD and read all the complex elements and its c
Author
BATMAN_2008



Joined: 30 Mar 2021
Posts: 2
Location: India

PostPosted: Wed 31 Mar '21 8:26    Post subject: How to parse XSD and read all the complex elements and its c Reply with quote

Detailed question with code: https://stackoverflow.com/questions/66874536/how-to-parse-xsd-and-read-all-the-complex-elements-and-its-child-elements-using

I am using the Apache XmlSchema Core library to parse the XSD file and get all the elements and its children type (datatype, maxOccurs, etc). I am following the documentation http://ws.apache.org/xmlschema/xmlschema-core/apidocs/index.html and trying to do. But after navigating to a certain point I am getting a bit confused. Can someone please guide me on how can I traverse through my XSD file and get all the elements and their child elements along with the related information?


I am able to get all the XSD information in my schema element I just want to know how can I access the child elements from my root RootFood and get its related information. Any help would be really appreciated.

I tried to continue further and this is what I have so far: The element RootFood belongs to the instance of the class XmlSchemaGroupParticle. I tried to debug the code to find the elements that are associated with my rootParticles, it has the field called items within which I have my food element items->[0]->namedDelegate->qName->localPart but when I try to add GET method on rootParticles to obtain the items then there is no such method.

The XmlSchemaParticle extends following classes: XmlSchemaAnnotated, XmlSchemaObject, and implements the interface XmlSchemaObjectBase but none of them have the field called Items.
Back to top


Reply to topic   Topic: How to parse XSD and read all the complex elements and its c View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner