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

Re: Namespaces, schemas, Simon's filters.

  • From: Peter Piatko <piatko@r...>
  • To: Tim Bray <tbray@t...>, Xml-Dev <xml-dev@l...>
  • Date: Sun, 19 Aug 2001 21:21:13 -0400

sed unicode

----- Original Message -----
From: "Tim Bray" <tbray@t...>
To: "Xml-Dev" <xml-dev@l...>
Sent: Sunday, August 19, 2001 3:48 PM
Subject: Namespaces, schemas, Simon's filters.


> Having spent some time reading this thread, I realized I
> didn't understand either local types or Simon's filters.
> As Ron Bourret said:
>
> >> I think the real culprit here isn't whether local element
> >> type names are
> >> qualified or not. It's that local element types exist at all.
>
> Upon further study, I think Ron's right.

I don't have a firm opinion on the existence of local element types.
However, I think it's a bit too easy to declare a local element in XSD.  By
this I mean that if I am someone who is only halfway knowledgable about the
schema language, the kind of default "no-brainer" way to write a schema is
as follows:

<xsd:element name="book">
    <xsd:complexType>
        <!-- oops, local element down below -->
        <xsd:element name="title" type="xsd:string"/>
        <!-- etc -->
    </xsd:complexType>
</xsd:element>

I might have never intended to define <title> as a local element.

To make matters worse, assuming I leave elementFormDefault at its default
value (defering to the infinite wisdom of the spec writers :-), I might
innocently write a test document as follows:

<b:book xmlns:b="somenamespace">
<!-- oops, the title element shouldn't be prefixed -->
<b:title>Schemas Made Complicated</b:title>
</b:book>

I'd then spend countless hours banging my head against the computer screen,
wondering why I keep getting validation errors (unless the validation tools
are nice enough to give me a hint---I haven't checked).

Of course, it's easy enough for me to complain.  I don't have a real
solution to the problem, except maybe writing some kind of "XSD lint" tool.

<snip/>

> Now, suppose I'm right.  If so, why are Simon's filters
> ever a good idea?  The XML Schema Rec allows me to write
> rules so that in the following
>
> <apo:purchaseOrder xmlns:apo="http://www.example.com/PO1"
>                    orderDate="1999-10-20">
>  <shipTo country="US">
>   <name>Alice Smith</name>
>   <street>123 Maple Street</street>
>   <!-- etc. -->
>
> the "apo" schema is used to validate the <shipTo> element.
> Nowhere does it say that the "shipTo" element is or should
> be in the "apo" namespace.  Applying Simon's filter will
> put "shipTo" in the apo namespace.  This behavior totally
> flies in the face of XML+Namespaces as specified.

Isn't Simon's filter a transformation tool, plain and simple?  If such
transformations give people a headache, then I think pretty soon people's
heads will be exploding.  ;-) I think it will only get worse.

To me, the power of XML is that such transformations are easily possible.  I
think it's great that people can apply /usr/bin/sed to XML instance
documents, if that's what they want to do.

> Also, if
> I read schemas right, it also won't schema-validate any more.
> So why would this ever be a good idea?  -Tim

That's probably right.  However, since he's transformed the original
instance, why should we assume that it has to validate?

Thanks,

Peter

P.S. Hmm, is /usr/bin/sed Unicode aware?



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.