[xsl] id idref pairs

Subject: [xsl] id idref pairs
From: DPawson@xxxxxxxxxxx
Date: Mon, 12 Feb 2001 14:01:06 -0000
I have xml which looks like


<test id="x">

  link to <link idref="x"/>blah


I want to output, in html,
  <p>link to TN 1 blah</p>

I have 
<xsl:template match="link">
   TN&sp; <a href="#{@idref}"> 
<xsl:call-template name="testnum" >
       <xsl:with-param name="node" select="@idref"/>

 <xsl:template name="testnum">
    <xsl:param name="node" select="."/>
      <xsl:when test="id($node)">
    <xsl:for-each select="id($node)">
      <xsl:text>TN:&sp;</xsl:text><xsl:number count="test"
    <xsl:otherwise><xsl:text>No TN for link</xsl:text>

My intent (not currently working), is to provide as output, the 
 number of the test in the document, by changing context from the calling
to that of the called test. I *think* the id(@idref) gives me the 
target node, and in the testnum context, the for-each changes context.
The test is to ensure I have the id attribute in the target element.

 Its not working. And I can't see why.

Any help appreciated.

TIA, DaveP

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

Current Thread