File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Dynamically validating xsd Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Dynamically validating xsd" Watch "Dynamically validating xsd" New topic

Dynamically validating xsd

Jack Thomson

Joined: Nov 14, 2002
Posts: 5

My task is to create a gui which will allow the user to select a xsd file and then create an xml file which will be successfully validated by the selected xsd file.

To do this, I need to be able to find out what the legal values of a selected element are and what are the legal child elements it can have etc. (And a whole load of other stuff as well...)

Is it possible to do this ? And if so, how ?

Thanks in advance.
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
Welcome to Javaranch Jack.

You can feed your XML and XSD to the exisiting validating parsers likes Xerces, Sun MSV and let them do the job of checking the element hierarchy, values etc.,

Hoep that helps ?

Spritle Software Blogs
Jack Thomson

Joined: Nov 14, 2002
Posts: 5

But I actually need to be able to do stuff like create a combobox containing the legal child values of an element...

So I need to find a way to find out info about the schema that's been selected...
I agree. Here's the link:
subject: Dynamically validating xsd
jQuery in Action, 3rd edition