473,388 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

May 24 '06 #1
2 2047


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/
May 24 '06 #2
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

May 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Kofi Sarfo | last post by:
Wondering what I'd use to evaluate the following to return 'Easy' <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="Answers.xsl"?> <answers> <answer>...
3
by: Ray Tayek | last post by:
hi, trying to use an xslt to make an xslt. trying something like: <?xml version="1.0" encoding="UTF-8"?> <?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?> <xsl:stylesheet...
1
by: Vijay singh | last post by:
Hi wonder if anybody can clear by doubt XML file : <score id="1"> <film>A Little Princess</film> <composer>Patrick Doyle</composer>
5
by: KJ | last post by:
I would like to know if there is a tool for download or purchase that will generate a skeleton xslt document, inserting all the xsl:template's matching each element specified in any given xsd. ...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
2
by: tentstitcher | last post by:
Hello: I am stumped on what I belive to be a namespace issue. The XSL, source XML, and result XML are included below. The problem is that the template to match "getBalances" is never invoked by...
2
by: eric.goforth | last post by:
Hello, What happens if you call an xsl template if you call it without setting the values of all it's parameters, I assume that the parameters will be either null or an empty string and the...
4
by: festo | last post by:
Hi guys, I need to print a different footer depending on the template being printed. How do I test for the current template being processed in XSLT? Thanks, fes
5
by: John Gordon | last post by:
My XSLT files have many occurrences of this general pattern: <a> <xsl:attribute name="href"> <xsl:value-of select="xyz" /> </xsl:attribute> </a> When I execute an XSL transform, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.