I am looking for clarification about how path steps are to be interpreted with respect to the issue of qualified/unqualified element names, and default or no-default namespaces.

If there is a precedent we can follow set by other tools which embed paths into XSD (e.g., schematron?) or even just the selector/paths things in XSD key/uniqueness constraints then I'd like to understand it.

These are some of the conundrums:

Two Schema Files: A, and B

Schema file A has target namespace AA, and binds the AA namespace to prefix aa, and the BB namespace to prefix bb
Schema file B has target namespace BB, and the same prefix bindings.

Schema B has an element named b1 which has two local element declarations inside it named c1 and c2.

Schema A has an element named a1 which contains an element reference to bb:b1.

a1 has a DFDL annotation (e.g., dfdl:assert) which has a path expression in it.  this path contains bb:b1/c1

When is the path correct?

1a) when schema B has elementFormDefault='unqualified' (that's the default), and schema A does NOT have a default namespace. Why? the default namespace - if it existed for schema A - would implicitly qualify the c1 step of the path, but since c1 is a local element in schema B with element form unqualified, it does not require (and cannot have) a namespace specified in path steps for c1.

1b) when schema B has elementFormDefault='qualified', and schema A has xmlns='BB'. Why? Because in this case the path bb:b1/c1 is equivalent to bb:b1/bb:c1, and since c1 will have a namespace-qualified name in schema B, that path will properly describe the path to the c1 element.

1c) Variation: when schema B has no target namespace (which I believe makes elementFormDefault irrelevant), and schema A has no default namespace. Because then c1 can't be qualfied as it lives in no namespace, and schema A has no implied qualifiers.

When is the path incorrect?

2a) when schema A has xmlns="BB". Why? Because the default namespace means the bb:b1/c1 is equivalent to {BB}b1/{BB}c1, but there is no {BB}/c1 since c1 is just a local element declaration, and B has elementFormDefault unqualified.

2b) when schema B has elementFormDefault='qualified', and schema A has no default namespace. In that case the step c1 needs a namespace qualifier either by default, or explicitly via a prefix, but it doesn't have one.

So I am interested in opinions on whether the above analysis is correct or not, and especially in precedent for how this stuff works in other tools.

I have made a big assumption above which is that if xmlns="BB", then any path step inside something carrying that default binding is interpreted as qualified by that namespace. I picked this because it seemed reasonable, and it seems one can always modify one's schema to properly address something in another schema without having to change that other schema. I.e., it seems to have good composition properties.

Thanks for any thoughts.


Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are subject to the OGF Intellectual Property Policy