|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








