Altova Mailing List Archives
>microsoft.public.xml Archive Home
>Thread Prev - Referencing one schema from another schema?
>Thread Next - Re: Referencing one schema from another schema?
Re: Referencing one schema from another schema?
Date: 6/22/2006 7:01:00 AM
I would put these schemas in a namespace, and then with the schema in which you want to reference a predefined element or complexType or simpleType, etc., use the xs:include to inherit from the schema that defines the element. lgardina@m... wrote: > I apologize if this is something basic but I have been researching on > this topic for a long time and I'm fairly new to xml schemas. > > Here is an example of what I'm trying to do: > I have a schema that defines a Customer. I also have a schema that > defines a Shipment. > A Customer has an Address as does a Shipment. > I WANT to define a schema to represent an Address one time and then > refer to it from my Customer and Shipment schemas so that they will > process the Address rules when they process an xml document, but I > don't want to have to define (repeatedly and redundantly) the rules for > an address over and over in every schema that would need it. > > Not unlike building classes and objects. I build an Address once and > reference and use it as many times as I need. It seems that schemas > can only reference things that are defined locally to themselves. Why > can I not accomplish this seemingly simple task? Seems like I'll have > way more "code" than I need to and managing change will be more > complicated by having to think about all the different places I might > define a common concept. > > Thanks for the help.