xsl-list
[Top] [All Lists]

Re: XPath 1.0 id() function

2005-08-23 07:15:59

Correction:
<xsl:for-each select="//*[(_at_)id = $idd]">

Should read:
<xsl:for-each select="//*[(_at_)id = $target]">

Nadia


                                                                                
                                                
                      Nadia(_dot_)Swaby(_at_)pwc(_dot_)                         
                                                                 
                      ca                       To:      
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                                
         
                                               cc:                              
                                                
                      2005-08-23 09:56         Subject: [xsl] XPath 1.0 id() 
function                                           
                      Please respond                                            
                                                
                      to xsl-list                                               
                                                
                                                                                
                                                
                                                                                
                                                




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="//*[(_at_)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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>