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

Re: id() doesn't work!?

Subject: Re: id() doesn't work!?
From: Daniel Veillard <daniel@xxxxxxxxxxxx>
Date: Fri, 23 Aug 2002 12:20:05 +0200
product id generator
On Thu, Aug 22, 2002 at 07:56:13PM +0200, Aaron Optimizer Digulla wrote:
> --------------------------- cut --------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <synopses>
>     <character id="char-usagi">
>             <name>Miyamoto</name>
>         </character>
> </synopses>
> --------------------------- cut --------------------------------------

  No DTD -> there is no id() defined for this document.

> After some hours of try&error, I finally found why it doesn't
> work: If the elements are not declared in a DTD, then id() doesn't
> work. DUH.
>
> Can someone please add a check to xsltproc which prints a warning if
> id() is used in a document which is only well-formed or, even better,
> if the document doesn't have any attributes with are declared as
> ID attributes.

  Hum, the spec (XPath) says:

http://www.w3.org/TR/xpath#unique-id

--------------------------
  NOTE: If a document does not have a DTD, then no element in the document will have a unique ID.
--------------------------

  this doesn't sound like a special processing should be attempted.
Moreover since XPath id() is also shared for example by XPointer,
that mean the XPointer would also generate the warning message, and 
I definitely don't want this 

  #xpointer(id('foo'))xpointer(//*[@id='foo'])

should not generate a warning IMHO.

  To me it's really a stylesheet/framework design constraint
if you use id() it will *never* work if your document doesn't have
a DOCTYPE (well at least for XPath-1.0 ...).

  So I'm not tempted to try this, you can still argue to convince
me though :-)

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@xxxxxxxxxx  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.