Altova Mailing List Archives


Re: Referencing one schema from another schema?

From: "smadden" <stephen.madden@---.--->
To: NULL
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.

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.