I think the answer lies in using XSModel in the following way http://www.mail-archive.com/[email protected]/msg06034.html
________________________________ From: chaman bagga <[email protected]> To: "[email protected]" <[email protected]> Sent: Wednesday, March 6, 2013 6:18 PM Subject: Re: parsing xsd using xerces c++ XSModel can be used to get the schema definition without an XML file. E.g. look at SCMprint ________________________________ From: Ben Griffin <[email protected]> To: [email protected]; chaman bagga <[email protected]> Sent: Tuesday, March 5, 2013 6:30 PM Subject: Re: parsing xsd using xerces c++ I guess I must be missing something - you want use PSVI over a schema (XSD) or over a schema instance? Once again I may be wrong, but I thought that PSVI is generated for an instance against it's schema, during the instance's validation. So, if you are treating the XSD as a validated XML document (a schema instance), using it's PSVI should not be a problem, right? > > Agree, I know this solution. PSVI is there to provide the type information of > XSD, and I would like to use the work already done there. Provided I can get > the structure of document using PSVI. > > > ________________________________ > From: Ben Griffin <[email protected]> > To: [email protected]; chaman bagga <[email protected]> > Sent: Tuesday, March 5, 2013 5:30 PM > Subject: Re: parsing xsd using xerces c++ > > I maybe totally missing the point, but why not just load the xsd file as an > xml file, and use the DOM / SAX APIs for crawling as you need? > > On 5 Mar 2013, at 11:43, chaman bagga <[email protected]> wrote: > >> >> I was looking more towards getting a tree structure from the PSVI. >> >> XSD would use similar algorithm to what I need to do. However, I can't use >> it as is because I need to process the type information dynamically. >> >> >> ________________________________ >> From: Jeroen N. Witmond [Bahco] <[email protected]> >> To: [email protected] >> Sent: Friday, March 1, 2013 10:49 PM >> Subject: Re: parsing xsd using xerces c++ >> >> You might want to take a look at http://www.codesynthesis.com/products/xsd/ >> >> It may be what you need. >> >>> >>> Hello Xerces Experts, >>> >>> I have a requirement to traverse the tree structure of an XSD file, and >>> then generate a tree like structure roughly corresponding to the hierarchy >>> of the XSD structure. >>> >>> I looked at SCMPrint.cpp in samples, but its not clear to me on how to do >>> a tree traversal (depth first pre-order I believe) of the structure. >>> >>> Any help / sample code is greatly appreciated. >>> >>> Regards, >>> Chaman.
