[xsl] XPath 1.0 id() function

Subject: [xsl] XPath 1.0 id() function
From: Nadia.Swaby@xxxxxx
Date: Tue, 23 Aug 2005 09:56:07 -0400
Hi all,

I am using fop 0.20.5 with xalan 2.4.1. For an XML Element that looks like
this:

<doclink target.id="ID001">Text here</doclink>
 I have a stylesheet snippet that looks like this:

<xsl:variable name="target" select="@target.id"/>
<xsl:variable name="xlabel">
      <xsl:value-of select="id($target)/@xreflabel"/>
</xsl:variable>

For some reason, this second variable declaration doesn't work (i.e. no
data is assigned to it).  I have to resort to this:

<xsl:variable name="xlabel">
      <xsl:for-each select="//*[@id = $idd]">
            <xsl:value-of select="@xreflabel"/>
      </xsl:for-each>
</xsl:variable>

After poking around the archives of the Xalan mailing list, it was
suggested somewhere that the id() function only works when the DTD is
declared in the XML Document.  Does anyone know if this is true?  Does
anyone else have issues with the id() function using other processors?

TIA
Nadia

Current Thread