Skip to main content

Parsing an XSD file

2 replies [Last post]
kram
Offline
Joined: 2007-10-23

Hello,

I was wondering if anyone could point me in the direction of a library or technique that will allow me to parse an XSD file, i.e. maybe getting a list of the top level elements in the XSD?

Thanks!
Mark

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pietblok
Offline
Joined: 2003-07-17

Hi Mark,

Don't XSD files just follow the rules of XML? If that is the case and you want to examine the contents on the XML level like finding top level elements (not the specifics on XSD), you need to look at the standard XML parsing techniques.

javax.xml.parsers and some accompanying packages
org.w3x.dom
org.xml.sax

All available in java SE

Hope this helps,

Piet

kram
Offline
Joined: 2007-10-23

Hi Piet,

Yeah I know what you mean, but Im designing my app to have a user interface that is more like a big "this is what you can do" type of interface.

So I was hoping to grab all top elements and make menu items etc... for them.

I guess that XSD's are just XML, so I could parse them like normal XML files. Thanks for the tips.

Mark