Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Fri, 16 May 2008 03:29:32 -0700 (PDT),    group: microsoft.public.xsl        back       


Match attributes   
Hi, I've got a question.

Let's say I have a file XML like that:

<root>
 <field name="a1" value="0" />
 <field name="a2" value="2" />
 <field name="a3" value="4" />
</root>

and I know I want to get value from field with attribute name "a2".
How can I access/match it with XSLT ? I tried many different ways but
with no success :( Although it's my second day with XSL :/
date: Fri, 16 May 2008 03:29:32 -0700 (PDT)   author:   jaPco

Re: Match attributes   
jaPco wrote:
> Hi, I've got a question.
> 
> Let's say I have a file XML like that:
> 
> <root>
>  <field name="a1" value="0" />
>  <field name="a2" value="2" />
>  <field name="a3" value="4" />
> </root>
> 
> and I know I want to get value from field with attribute name "a2".
> How can I access/match it with XSLT ? I tried many different ways but
> with no success :( Although it's my second day with XSL :/

Try an XSLT/XPath tutorial, the direct "way" to that attribute value is e.g.

     <xsl:value-of select="/root/field[@name = 'a2']/@value"/>





-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Fri, 16 May 2008 14:05:10 +0200   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us