W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

namespace coercion, best practices, and parser interoperability

From: Paul Kiel <paul@xmlhelpline.com>
Date: Tue, 5 Mar 2002 09:07:21 -0500
Message-ID: <008f01c1c44f$11443df0$ce38a318@pkiel2>
To: <xmlschema-dev@w3.org>
Re: XML schema validationGreetings,

I have discovered differences in the way parsers implement namespace coercion which can affect schema design.  The difference occurs when one schema imports a schema with a different namespace and both schemas need the same no-namespace schema.  For example,

A (ns="A")  imports B (ns="B") and includes C (ns="")
B (ns="B") includes C (ns="")

In this scenario, both schemas A and B need the use of C coerced into their respective namespaces.  However, the fact that A also imports B presents a difference in parsers.  Some tools resolve C into B (coerce it into "B" namespace) before importing it into A.  Then A is able to coerce C as well and we have no problem.  

However, other tools seem to resolve these as they are encountered and don't coerce as they go.  So C is not coerced into B namespace, but coerced directly into A namespace.  Then the include of C directly into A is viewed as a duplicate and is discarded.  Thus we have the use of C in the A namespace but do not have the use of C in B namespace.

In reading the spec, I was not able to locate how parsers should implement this feature.  So I concluded that it may be the case that both of these methods are correct implementations and that this problem will not go away.  If I am correct in all this (a huge "if" for sure) then it would be worth putting into the Best Practices.

(For the record, I won't name parsers but say that I tested it in 6 tools, with 3 acting one way and 3 the other.)

Ok, I would love for someone to tell me that the parsers implement this consistently but my experience and conclusions are somehow flawed.

Thanks in advance,

Paul Kiel
(p.s. I've read the Best Practices web site material, so I apologize if this is in there but overlooked on my part.)
Received on Tuesday, 5 March 2002 09:04:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC