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

Re: Re: determining ID-ness in XML

  • From: Rob Lugt <roblugt@e...>
  • To: "Henry S. Thompson" <ht@c...>,Michael Fuller <msf@m...>
  • Date: Thu, 01 Nov 2001 11:55:31 +0000

foo id
Henry S. Thompson wrote
>
> 1) They're [PIs] not scoped, everything else about the language is.
> 2) They're not declared in the grammar (DTD/Schema)
>

These are the two reasons why I believe PIs may be the better approach.
Allow me to explain:

(2) is useful because it allows us to introduce new concepts retrospectively
without breaking existing applications and grammars.

<going long>

In my view the ideal solution to the ID-less problem would have been to make
use of the internal DTD subset.  James Clark has pointed out [1] that this
is not suitable for streaming.  As PIs can be placed after the prolog, they
are not subject to this restriction.

You say (1) that PIs are not scoped.  This could possibly be useful.  James
Clark [1] introduced xml:idatt with the concept of inheritance.  However, I
can contrive an example where this would not be helpful:-

<root xml:idatt="id">
 <foo id="a"/>
 <foo id="b"/>
 <foo id="c"/>
 <!-- following have a id attr that should not be treated as ID -->
 <bar id="a"/>
 <bar id="c"/>
 <bar id="d"/>
<root/>

The ugly solution would be to specify xml:idatt on each of the foos or each
of the bars.  The other alternative of introducing a new parent element for
all of the bars may not be acceptable for the application/grammar.

The PI alternative has no such problems:
<root>
 <?xml-typeinfo  idnames="id"?>
 <foo id="a"/>
 <foo id="b"/>
 <foo id="c"/>
 <!-- following have a id attr that should not be treated as ID -->
 <?xml-typeinfo  idnames=""?>
 <bar id="a"/>
 <bar id="c"/>
 <bar id="d"/>
<root/>

Conceptually, we could say that PIs do have scope.  A reasonable definition
would be that they cover everything from the point of declaration to the end
of the containing element.  This would be a similar kind of scope to
variables in C++.  PIs occurring before the root element would have "file
scope", PIs occurring in element content would be 'visible' from the point
of declaration until the end of that element, including child elements
occurring after the PI, but not those occurring before it.

Regards
~Rob

--
Rob Lugt
ElCel Technology
http://www.elcel.com

[1] http://lists.xml.org/archives/xml-dev/200110/msg01051.html



PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.