permaculture playing cards
The moose likes XML and Related Technologies and the fly likes validating with multiple schemas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "validating with multiple schemas" Watch "validating with multiple schemas" New topic

validating with multiple schemas

b stone

Joined: Feb 14, 2005
Posts: 2
I've got about five XML Schemas with each schema calling an include to the one before it, so it's basically a one-branch tree. For instance my schema Dog.xsd would include Mammal.xsd, Mammal.xsd would include Animal.xsd, and then Animal.xsd would include Organism.xsd. This way, everything in Dog.xsd can access everything in Mammal.xsd, Animal.xsd, and Organism.xsd.

My question then is, is there a way to put all the schemas into one file so that i could request any element in any .xsd at any time?

For instance, in the code below, i'm getting the attribute of one of the elements in Dog.xsd.

What i want to be able to do is just search through all the schemas for a specific attribute.

So is there any way to combine all the schema files into one, and then be able to search through that file for specific attributes, all with Java code?

That way, i could replace the above "./Dog.xsd" with "/.AllSchemas.xsd" (AllSchemas being the xsd that holds everything inside each schema.

So my main question is, how do i write the file AllSchemas in Java to include all those smaller schema files i already have?

And i need to keep the schemas separate (so i am unable to just write one entire schema file from the beginning), i only want to combine them temporarily for this search.
b stone

Joined: Feb 14, 2005
Posts: 2
No one has any ideas for this?

I was recently informed that there was a method you could call in Java that takes in an XML and as many schemas as you want and verifies against them.

Can anyone confirm or deny this?
I agree. Here's the link:
subject: validating with multiple schemas
It's not a secret anymore!