W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2000

Re: CR Feedback and Implementation

From: David Beech <David.Beech@oracle.com>
Date: Mon, 18 Dec 2000 11:14:59 -0800
Message-ID: <3A3E6233.4FB1C227@oracle.com>
To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
CC: "Falk, Alexander" <al@altova.com>, www-xml-schema-comments@w3.org
"Henry S. Thompson" wrote:
> 
> Thanks for your detailed comments.  Note for good public relations,
> it's best not to send mail directly to both a public
> (www-xml-schema-comments) and a member-only (w3c-xml-schema-ig) list
> at the same time.
> 
> I'll respond to a few things I think we could use some clarification
> on or where I think you've perhaps misunderstood something:
> 
> "Falk, Alexander" <al@altova.com> writes:
> 
> > 1) the CR should perhaps expressedly inform the reader, that any schema
> > document that uses a default namespace (ie no prefix) to refer to
> > "http://www.w3.org/2000/10/XMLSchema" must have a targetNamespace - otherwise
> > any type="..." or ref="..." can not be correctly attributed to either the
> > built-in types of XML schema or the types that the user defines in his/her
> > schema
> 
> I'm not sure I understand.  The following is perfectly valid:
> 
> <schema xmlns="http://www.w3.org/2000/10/XMLSchema">
>  <element name="foo">
>   <sequence>
>    <element name="bar" type="integer"/>
>    <element name="baz" type="date"/>
>   </sequence>
>  </element>
> </schema>
> 

Yes, but the following is not:

<schema xmlns="http://www.w3.org/2000/10/XMLSchema">
 <element name="foo" type="fooType"/>
 <complexType name="fooType">
  <sequence>
   <element name="bar" type="integer"/>
   <element name="baz" type="date"/>
  </sequence>
 </complexType>
</schema>

Of course, an explicit schema prefix works:

<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
 <xsd:element name="foo" type="fooType"/>
 <xsd:complexType name="fooType">
  <xsd:sequence>
   <xsd:element name="bar" type="xsd:integer"/>
   <xsd:element name="baz" type="xsd:date"/>
  </xsd:sequence>
 </xsd:complexType>
</xsd:schema>

Although this style is heavier, it is always safe.  It seems to have
the additional advantage that XSLT can be applied to such schemas by
using exactly the same prefixed element names to refer to them.  
Whereas if one has used default namespace declarations in the 
schemas, XSLT forces one to introduce prefixes and use them when 
referring to the elements that are unprefixed in the schemas.


  David
Received on Monday, 18 December 2000 14:18:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT