Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - xsl:template - access attribute from one level up

 
Thread Tools Search this Thread
Old 05-24-2006, 03:53 PM   #1
Default xsl:template - access attribute from one level up


If I have the following XML:

<xml>
<levelone>
<leveltwo attribute="value">
<levelthree attribute2="value2">
Some Value
</levelthree>
</leveltwo>
</levelone>
</xml>

And the following XSL:

<xsl:template match="ns1:levelthree">
.....
</xsl:template>

How would I refer to the the value of '@attribute' from leveltwo?

I have tried a couple of different ways, but without a lot of luck!

Many thanks

Darren



daz_oldham
  Reply With Quote
Old 05-24-2006, 04:51 PM   #2
Martin Honnen
 
Posts: n/a
Default Re: xsl:template - access attribute from one level up



daz_oldham wrote:


> <xml>
> <levelone>
> <leveltwo attribute="value">
> <levelthree attribute2="value2">
> Some Value
> </levelthree>
> </leveltwo>
> </levelone>
> </xml>
>
> And the following XSL:
>
> <xsl:template match="ns1:levelthree">
> .....
> </xsl:template>
>
> How would I refer to the the value of '@attribute' from leveltwo?


../@attribute

--

Martin Honnen
http://JavaScript.FAQTs.com/
  Reply With Quote
Old 05-24-2006, 04:57 PM   #3
daz_oldham
 
Posts: n/a
Default Re: xsl:template - access attribute from one level up

Thanks Martin - I missed out the fact that I am in fact going up two
levels and not one.

You don't have to call me an idiot, I already know

Many thanks

Darren

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump