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

RE: Enlightenment via avoiding the T-word

  • From: Nicolas LEHUEN <nicolas.lehuen@u...>
  • To: "'xml-dev@l...'" <xml-dev@l...>
  • Date: Thu, 30 Aug 2001 09:11:32 +0200

RE: Enlightenment via avoiding the T-word
> From: "Christian Nentwich" <c.nentwich@c...>
> > >   <xsl:template match="x:name">
>> >      <xsl:if select="parent::x:person">
>> >          <!-- oops I need this extra test because name is reused--
>> >         those darned people at x:: namespace keep on adding
>> >         new local elements and our code is written to just use
>> >         the markup. Why cannot they just use vanilla XML.... -->
>> 
>> Isn't this cheating slightly ? If you work based on a 
>context, you would
>> quite likely call a template
>> instead of matching one. I am with Nicolas here in that I think it's
>> quite unlikely that you want to process name without being in the
>> process of processing (sorry :) a particular parent node.
>
>
>Either way doesn't change the point.  If you have a script written
>(using names not vapor-PSVI)
>under the assumption that there are no local types (or, at least, 
>a known set of local types, the others being global, and the
>local type not being a compatible restriction of the global type), then
>introducing local types forces you to do some more programming
>to fix it.  It is not robust.

What you are basically saying is that if you present to your script some
data which does not follows the assumption made when writing the script, it
won't work. Right. I don't see what is the point about local elements, or
even XML. This is the same for any kind of program and any kind of data.

For sure, if you assume that all XML document contain only
context-insensitive element names, all the scripts you write will break when
encountering a schema that does not make the same assumption. Maybe this is
the reason why you want to banish context-sensitive names.

>The reuse of the element may cause some failure, but it is just
>as likely to introduce spurious data.  
>
>Contrast this with adding a new global--per-namespace name.
>Your script will already have handled this: either strip or 
>fail, probably.

Well, if you are worried about some unknown content being presented to your
script, you should probably validate it against the schema your script is
written for beforehand. 

I agree that if you apply a context-insensitive script to context-sensitive
data, the result will be catastrophic, as some element could be semantically
interpreted as others.

However, If you write your scripts in a context sensitive way (which is not
really more complicated), you can handle incorrect documents easily. 

>Cheers
>Rick Jelliffe

Regards,
Nicolas

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.