This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: conditionally accessing attribute value of the same node


	<xsl:when test="//choice/action/@type[.='accept']">
		<xsl:value-of select="//choice/action/@imodetask" />
	</xsl:when>


Translating into English:

When I have an attribute called "type" whose value is equal to the
string "accept" somewhere on the tree, which is a child of an element
"action" and a grandchild of an element "choice", give me the first
value of the "imodestask" attribute on the tree which is also a child of
an element "action" and a grandchild of an element "choice".

i.e. your use of the // at the front makes your XPath pretty
meaningless.

Ben

> -----Original Message-----
> From: Yogesh [mailto:yogeshd@cybage.com]
> Sent: 28 June 2001 16:48
> To: xsl-list@lists.mulberrytech.com
> 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
> 
> 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]