Subject: RE: [xsl] conditionally accessing attribute value of the same nod e From: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx> Date: Thu, 28 Jun 2001 09:09:17 -0700 |
Your xsl:when test is true, because there is an attribute with the correct value. Therefore the code inside the xsl:when is executed. Its selection is all nodes that match "//choice/action/@taskid" (I assume that's what you meant); this is a result tree fragment containing the two nodes 20 and 21. Then xsl:value returns the string value of the first of these nodes, so you get 20. Your comment about the "same" node doesn't apply because you haven't done xsl:apply-templates or xsl:for-each to set the current node. PC2 -----Original Message----- From: Yogesh [mailto:yogeshd@xxxxxxxxxx] Sent: June 28, 2001 08:48 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] conditionally accessing attribute value of the same node Hi All, I am facing problem when I am conditionally accessing attribute value of the same node. My Code is like this: <choice name="news" key="type"> <action type="soft1" task="go" label="CBSMW" taskid="20"></action> <action type="accept" task="go" label="Go" taskid="21"></action> -News- <ce value="rt.asp">RealTime Headlines</ce> <ce value="mp.asp">MarketPulse</ce> <ce value="tn.asp">Ticker News</ce> </choice> In My XSL I check for action node for type = accept.If I get that action node then I want to access its taskid.But I am not able to access it.The code which is used for this actually gives me taskid for the other action node(first node of type soft1) XSLT code: This is part of <xsl:choose> <xsl:when test="//choice/action/@type[.='accept']"> <xsl:value-of select="//choice/action/@imodetask" /> </xsl:when> Here after applying this XSL I get taskid for action type=accept as 20 and not 21. Please advice where I am wrong. Thanx in advance. Yogesh. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] conditionally accessing a, Ben Robb | Thread | [xsl] xsl:sort Please Help, Paul_B_Grimes |
[xsl] Re: conditionally accessing a, Lauren Blau Halverso | Date | RE: [xsl] Generating Link Reference, Rene de Vries |
Month |