• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Parsing XSD using Xerces

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to parse a generic XSD and create sample XMLs conforming to the XSD. I am using Xerces for Java.

Does Xerces provide support for parsing XSD or do i have to parse it as a regular XML ? If theres support in Xerces, how do i do it?
Also could someone point to way/technique by which i can create all possible XMLs conforming to an XSD.

Thanks.
 
Sheriff
Posts: 28360
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A schema is an XML document, so yes, Xerces does support parsing one as XML. I don't know what else you would want from Xerces anyway.

And if you think about it, almost any non-trivial schema describes an infinite number of possible XML documents, so there is no way to generate all of them.
 
Moha Shaf
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I understand that an XSD can be parsed as a normal XML but I do not wish to do that. I believe that there is an object representation of the XSD which the Xerces uses to validate an XML. Is there a way to get handle to that object and get information of the schema in a logical way using its methods or some other way.
I found a sample for the C++ version of xerces but not able to find the source of this sample --> http://xerces.apache.org/xerces-c/scmprint-3.html
Also I do not wish to generate all possible XMLs conforming to schema, I only want to generate the XMLs with boundary values for all the constraints in the schema.

Any help/ pointer would be appreciated.

Thanks.
 
Moha Shaf
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could someone tell if there is any equivalent API in Xerces Java to Traverse through the XSD and access different segments of the XSD in a logical way.
Any help would be appreciated.

Thanks
 
permaculture is largely about replacing oil with people. And one tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic