[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Namespaces, W3C XML Schema (was Re: ANN: SAX Filters forNamespacePro

  • From: Aaron Skonnard <aarons@d...>
  • To: Xml-Dev <xml-dev@l...>
  • Date: Tue, 31 Jul 2001 21:20:53 -0700

s schema
<snip/>

[Simon]
> Namespaces in XML provides a means of pinning down element and
attribute
> identifiers to avoid potential conflicts.  By blessing the use of
> unqualified names within namespace-qualified contexts, W3C XML Schema
> makes precise identification of those identifiers a much more complex
> task.

On the contrary, consider the following XML schema definition and sample
instance document:

<!-- schema definition -->
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" 
    xmlns:tns="http://example.org/foo" 
    targetNamespace="http://example.org/foo"
    elementFormDefault="qualified">
  <s:element name="bar" type="s:string"/>
  <s:complexType name="fooType">
    <s:sequence>
      <s:element name="bar" type="s:string"/>
    </s:sequence>
  </s:complexType>
  <s:element name="foo" type="tns:fooType"/>
</s:schema>

<!-- instance -->
<f:foo xmlns:f="http://example.org/foo">
  <f:bar/>   <--|
</f:foo>        |
                |
                |       
Even when everything is qualified, you still can't figure out which bar
element this is just by looking at the QName and ignoring context (is it
the global or local qualified bar element?). 

And since everyone's already used to dealing with attributes based on
context [1], I don't see why local elements complicates things further.
As an example, consider the version attribute in XSLT. When used on a
literal result element, it must be qualified. But when used on the
xsl:transform element, it must be unqualified, depending completely on
context.
 
The only thing that matters is that both sides know when local scoping
is in use - either via schema definitions or human readable specs.
Whether or not it's harder to process locals vs. qualified elements is
debatable. 

[1] http://www.w3.org/TR/REC-xml-names/#ns-breakdown

-aaron

DevelopMentor
http://staff.develop.com/aarons



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.