[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath 1.0 id() function

Subject: Re: XPath 1.0 id() function
From: Nadia.Swaby@xxxxxx
Date: Tue, 23 Aug 2005 10:15:59 -0400
nadia target
Correction:
<xsl:for-each select="//*[@id = $idd]">

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

Nadia


                                                                                                                                
                      Nadia.Swaby@pwc.                                                                                          
                      ca                       To:      xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                         
                                               cc:                                                                              
                      2005-08-23 09:56         Subject:  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="//*[@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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.