Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: multiple namespaces

From: "Andrew Welch" <andrew.j.welch@-----.--->
To: "Michael Kay" <mike@--------.--->
Date: 4/23/2007 6:10:00 PM
On 4/23/07, Michael Kay <mike@s...> wrote:
> > The keys points here are:
> >
> > - there are two namespaces
> > - each namespace contains elements in the other namespace
> >
> > In order to model this I created two schema documents ns1.xsd
> > and ns2.xsd which import each other:
>
> Correct.

Great - surprising little on the web for handling XML with multiple
namespaces (where I looked anyway...)

> > I'd like any comments on this approach - its seems strange to
> > have circular imports
>
> Think Java "import" rather than XSLT "import". It's not at all strange in
> Java for two modules to import each other. In XSD, import means "this module
> references components defined in that module".

Ahh ok.  Would there be three instances then: A -> B -> A (two
instances of A, so no circular definition) ?

> , and when referencing the simpleType
> > and the group prefixes are needed - unless as Mike says I add
> > a default namespace, which I think would make the top of the
> > schema document:
> >
> > targetNamespace="firstNamespace"
> > xmlns:ns1="firstNamespace"
> > xmlns="firstNamespace"
> >
> > ...which is fine but a little non-intuitive at the moment -
> > is there a preferred approach?
>
> One sees different coding styles, but it's certainly not unusual to see
> schema documents that are just like this: the targetNamespace is bound both
> to an explicit prefix and to the default namespace. Personally I tend to use
> the prefix, it helps to remind the reader what's going on and makes it
> easier to cut-and-paste across schema documents.

Me too.

You do get a good sense of achievement as the complexities of XML
Schema start to unravel...

From mike@s... Mon Apr 23 16:31:27 2007
Received: from maggie.w3.org ([193.51.208


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent