RE: trouble with "What's in the target Namespace?"

Priscilla:

I tried the redeclaration, and XSV complained about it. But Xerces allowed
it.

Thanks.

Don

-----Original Message-----
From: Priscilla Walmsley [mailto:priscilla@walmsley.com]
Sent: Friday, October 19, 2001 9:03 AM
To: donalds@isogen.com; 'Schema Dev (E-mail)'
Subject: RE: trouble with "What's in the target Namespace?"


Hi Don,

You can also declare it locally twice, as in:

<xsd:element name="performance">
 <xsd:complexType>
  <xsd:sequence>
    <xsd:element ref="isg:performer"  />
    <xsd:element name="BBB"  type="xsd:boolean" />
    <xsd:element name="NNN" type="xsd:date" />
    <xsd:element name="BBB"  type="xsd:boolean" />
  </xsd:sequence>
 </xsd:complexType>
</xsd:element>

However, if you do this, both declarations for "BBB" must have the same type
(e.g. xsd:boolean).  They can have different default values, annotations,
etc.  You also have to make sure it doesn't result in a non-deterministic
content model, which it does not in this case.


Priscilla

-----------------------------------------------------------
Priscilla Walmsley                   priscilla@walmsley.com
Vitria Technology                     http://www.vitria.com
Author, Definitive XML Schema    (Prentice Hall, Dec. 2001)
-----------------------------------------------------------

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of Don Smith
> Sent: Friday, October 19, 2001 9:37 AM
> To: priscilla@walmsley.com; 'Schema Dev (E-mail)'
> Subject: RE: trouble with "What's in the target Namespace?"
>
>
> Priscilla:
>
> Interesting. Xerces 1.4.3 allows the reference to the locally declared
> elements, and I hadn't tried it with XSV, so I was thinking
> it was allowed.
>
> So the only way to have a structure like "BBB, NNN, BBB" is
> to have one or
> both BBBs refer to a global declaration? OK.
>
> Thanks.
>
> Don
>
> -----Original Message-----
> From: Priscilla Walmsley [mailto:priscilla@walmsley.com]
> Sent: Friday, October 19, 2001 8:17 AM
> To: donalds@isogen.com; 'Schema Dev (E-mail)'
> Subject: RE: trouble with "What's in the target Namespace?"
>
>
> Hi Don,
>
> > The last declaration refers to the element declaration "BBB",
> > and since that
>
> Your example is not valid because you cannot have a reference
> to a locally
> declared element.  Only globally declared elements can be referenced.
>
> > I conclude that when asking whether something is in the
> > target namespace,
> > one must distinguish between schema components and
> > information items in the
> > document instance. When speaking of schema components,
>
> Given that you can't reference locally declared elements, I
> don't think
> there is any need to distinguish between the instance and the schema.
> Locally declared elements and attributes are in the target
> namespace if
> their form is qualified, and have no namespace if their form
> is unqualified.
> Globally declared elements and attributes are always in the target
> namespace.  This is true both in the schema and the instance.
>
> Hope that helps,
> Priscilla
>
> -----------------------------------------------------------
> Priscilla Walmsley                   priscilla@walmsley.com
> Vitria Technology                     http://www.vitria.com
> Author, Definitive XML Schema    (Prentice Hall, Dec. 2001)
> -----------------------------------------------------------
>
> > -----Original Message-----
> > From: xmlschema-dev-request@w3.org
> > [mailto:xmlschema-dev-request@w3.org]On Behalf Of Don Smith
> > Sent: Friday, October 19, 2001 8:59 AM
> > To: Schema Dev (E-mail)
> > Subject: trouble with "What's in the target Namespace?"
> >
> >
> > The question "What's in the target namespace?" has become a point of
> > discussion around here. Here's an example to consider:
> >
> > <xsd:schema xmlns:xsd = 'http://www.w3.org/2001/XMLSchema'
> > 	 targetNamespace = 'http://isogen.com/training'
> > 	 xmlns:isg = 'http://isogen.com/training' >
> >
> > <xsd:element name="performer" type="xsd:boolean"  />
> >
> > <xsd:element name="performance">
> >  <xsd:complexType>
> >   <xsd:sequence>
> >     <xsd:element ref="isg:performer"  />
> >     <xsd:element name="BBB"  type="xsd:boolean" />
> >     <xsd:element name="NNN" type="xsd:date" />
> >     <xsd:element ref="BBB" />
> >   </xsd:sequence>
> >  </xsd:complexType>
> > </xsd:element>
> >
> > </xsd:schema>
> >
> > In the content model, the first element declaration refers to
> > the globally
> > declared "performer", which is clearly in the isogen namespace.
> > The second element declaration, "BBB", is locally declared
> > and not in the
> > target namespace.
> > Likewise for the next declaration, "NNN".
> > The last declaration refers to the element declaration "BBB",
> > and since that
> > schema component is not in the target namespace, the
> > reference does not have
> > a namespace prefix for the isogen namespace.
> >
> > The two references, one to a global declaration, and the
> > other to a local
> > declaration, indicate the different symbol spaces for
> global and local
> > declarations, the latter not participating in the target namespace.
> >
> > I conclude that when asking whether something is in the
> > target namespace,
> > one must distinguish between schema components and
> > information items in the
> > document instance. When speaking of schema components,
> > locally declared
> > components are not in the target namespace. When speaking of
> > information
> > items in the document instance, they either are or are not in
> > the target
> > namespace depending on: 1) whether they map to locally or
> > globally declared
> > elements, 2)the global/local "form" settings.
> >
> > Is this correct? Where in the spec is the status of local
> > schema components
> > relative to the target namespace addressed?
> >
> > Don Smith
> > ISOGEN International
> >
> >
>
>
>

Received on Friday, 19 October 2001 10:11:14 UTC