[oXygen-user] XSLT and id() function

Linus Kamb
Wed May 23 13:36:18 CDT 2007

trying to sort something out...

XSLT (through XPath, I guess (http://www.w3.org/TR/xpath#function-id) has an id() function that, if 
I understand the docs correctly, will return the node (or nodeset, if the parameter is a nodeset of 
id strings) from the document that has the given id value.


Now, one problem.  For that to work, apparently the id value needs to be declared as an attribute of 
ID type in a DTD.  Bummer.  See note in http://www.w3.org/TR/xslt#section-Embedding-Stylesheets.

Ok, so I tried that, but Oxygen doesn't seem to find it.

Does Oxygen (and/or XSLT in general, to your knowledge) support the id() function in XSLT?  Can it 
work with an ID-typed element?

My problem is that I am presented with an XML document that makes heavy use of IDREF type elements 
and I'm trying to transform them in XSLT.  Perhaps there's a better way or I'm doing something 
wrong.  Will post to xml dev list if this comes back negative.

attached are my (hackish! just trying stuff out) xml, xsd, and xsl files I've been using to test. 
Note that in the xsl

         <xsl:variable name="onode" select="id(oid)"/>
         ids:<xsl:value-of select="$onode"/>

"onode" is null (well, empty nodeset.)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: xml1.xml
Type: text/xml
Size: 896 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20070523/e24a0789/attachment.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schema1.xsd
Type: text/xml
Size: 1123 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20070523/e24a0789/attachment-0001.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfrm1.xsl
Type: text/xml
Size: 1235 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20070523/e24a0789/attachment.xsl 

More information about the oXygen-user mailing list