This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: id() doesn't work!?


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@redhat.com  | 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]