Mike -  In the absence of explicit qualification, you cannot unambiguously say whether type bar is in your namespace or notarget namespace.  It should be flagged as an error in my opinion...



From:        Mike Beckerle <mbeckerle.dfdl@gmail.com>
To:        dfdl-wg@ogf.org
Date:        03/16/2012 05:04 PM
Subject:        Re: [DFDL-WG] XML Schema do type references have to be qualified?
Sent by:        dfdl-wg-bounces@ogf.org




So, I did some research, and answered my own question.

Section 3.3.4.2 of "Definitive XML Schema" by Walmsley, says that the
schema below is illegal as the name
"bar" will be interpreted as a reference to xsd:bar, not the targetNamespace.

However, it seems many XML Schema processors may be tolerant of this error.


On Fri, Mar 16, 2012 at 4:48 PM, Mike Beckerle <mbeckerle.dfdl@gmail.com> wrote:
> Suman,
>
> In and XMLSchema/DFDLSchema do I have to qualify the names of types?
>
> We have a bunch of test schemas written roughly like the example
> below. They all have the default unprefixed namespace as XML Schema's
> namespace. They also all have a target namespace.
>
> But some or all of the type references to named types use unqualified
> names. In my mind, that means they would be assumed to be in the XML
> Schema namespace, not the targetNamespace.
>
> On the other hand, the XML Schema validator doesn't complain. But that
> just means the schema is valid, not necessarily meaningful.
>
> Example here:
>
> <schema xmlns="
http://www.ogf.org/dfdl/dfdl-1.0/XMLSchemaSubset"
> targetNamespace="
http://example.com">
> <element name="foo" type="bar"/><!-- IS THIS LEGAL, no prefix on name> of the type. -->
> <complexType name="bar">
>   <sequence/>
> </complexType>
> </schema>
>
>
> Mike Beckerle | OGF DFDL WG Co-Chair
> Tel:  781-330-0412



--
Mike Beckerle | OGF DFDL WG Co-Chair
Tel:  781-330-0412
--
 dfdl-wg mailing list
 dfdl-wg@ogf.org
 
https://www.ogf.org/mailman/listinfo/dfdl-wg