Mark Brucks <bru...@charter.net> wrote on 10/22/2010 06:23:03 PM:

> Your example is still dealing with the interpretation of a prefix in
> an existing document, and I don't have an existing document.  I am
> in control of which namespaces and which prefixes would be used.

I was just giving a "simple" example. XML schema documents are XML
documents. Unless you were also the schema author you have no control over
whether the schema documents declare prefixes in this way.

> HOWEVER, your last statement hits the nail on the head and explains
> everything.  Indeed, I have schema split across multiple documents,
> where a given prefix could be used for multiple namespaces and any
> namespace could have multiple prefixes.  I realized that this
> situation could occur in instance documents, without once thinking
> that the same would be true for a schema composed from multiple
> files.  Of course, the sample schema I created have unique prefixes!
>
> Sorry for being so dense, and thanks for the replies.
>
> Mark
>
> On Oct 22, 2010, at 2:24 PM, Michael Glavassevich wrote:
>
> > I think an example will help to illustrate why such a method makes
> no sense in the API. Consider the following document:
> >
> > <a:root xmlns:a="http://a"; xmlns:b="http://b";
> >        xmlns:y="http://y"; xmlns:z="http://z";>
> > <a:a xmlns:a="http://www.abc.com"; xmlns:x="http://www.xyz.com";>
> >  <a:a xmlns:a="http://www.xyz.com"; xmlns:x="http://www.abc.com"/>
> > </a:a>
> > <y:a xmlns:b="http://www.abc.com"; xmlns:y="http://www.xyz.com";>
> >  <y:a xmlns:b="http://www.xyz.com"; xmlns:y="http://www.abc.com"/>
> > </y:a>
> > </a:root>
> >
> > What is the prefix for "http://www.abc.com";? Without also
> considering the context you can't give a sensible answer. An XSModel
> may be composed of multiple schema documents which could also have
> different prefix mappings in each of them for the same namespaces.
> >
> > Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to