473,467 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using XML Attributes in an XSLT StyleSheet

Does anyone know how to get to the Attributes of an XML node when XSLT
constructing transformation templates.

I can do this

<xsl:template select="op:title"/>

. . .
<book>
<title>I can use this value</title>
</book>

But how to I get at the title attribute ?????

<book title="I want the title attribute">
<xsl:template select= ??????? >
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
Nov 20 '05 #1
3 1060
Hi again Terry, almost there - try (prefixed by names space if necessary)

<xsl:template select="@title"/>
Hex
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to get to the Attributes of an XML node when XSLT
constructing transformation templates.

I can do this

<xsl:template select="op:title"/>

. . .
<book>
<title>I can use this value</title>
</book>

But how to I get at the title attribute ?????

<book title="I want the title attribute">
<xsl:template select= ??????? >
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

Nov 20 '05 #2
should read "namespace", not "names space" - silly autocorrect in my mailer
:(
"Hexathioorthooxalate" <ru***@spameremove.clara.co.uk> wrote in message
news:10****************@nnrp-t71-03.news.uk.clara.net...
Hi again Terry, almost there - try (prefixed by names space if necessary)

<xsl:template select="@title"/>
Hex
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:Ox**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to get to the Attributes of an XML node when XSLT
constructing transformation templates.

I can do this

<xsl:template select="op:title"/>

. . .
<book>
<title>I can use this value</title>
</book>

But how to I get at the title attribute ?????

<book title="I want the title attribute">
<xsl:template select= ??????? >
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing


Nov 20 '05 #3
Thanks Hex, I'll try it tomorrow and report back. I'm off out for a pint

;-D

Cheers

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Hexathioorthooxalate" <ru***@spameremove.clara.co.uk> wrote in message
news:10****************@nnrp-t71-03.news.uk.clara.net...
should read "namespace", not "names space" - silly autocorrect in my mailer :(
"Hexathioorthooxalate" <ru***@spameremove.clara.co.uk> wrote in message
news:10****************@nnrp-t71-03.news.uk.clara.net...
Hi again Terry, almost there - try (prefixed by names space if necessary)
<xsl:template select="@title"/>
Hex
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to get to the Attributes of an XML node when XSLT
constructing transformation templates.

I can do this

<xsl:template select="op:title"/>

. . .
<book>
<title>I can use this value</title>
</book>

But how to I get at the title attribute ?????

<book title="I want the title attribute">
<xsl:template select= ??????? >
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing



Nov 20 '05 #4

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

Similar topics

1
by: Hyunchan Kim | last post by:
To indent xml file, I made an instance of Transformer from Templates using following. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
1
by: Wolfgang | last post by:
XSLT transformations by default seem to pass name space attributes into the root element of their output (example below). QUESTION: Is it possible to control this, i.e. not genrating a name...
9
by: Soren Kuula | last post by:
Hi, I just can't find namespaces of attributes stated clearly enough in the XML namespace spec. But .. I hear rumors that attributes, unless qualified otherwise, default to the namespace of the...
3
by: Stephan Brunner | last post by:
Hi I have created two flavors of an XSLT stylesheet to transform all attributes of an XML document to elements: They both work as expected with MSXML and XMLSPY but throw an exception ...
1
by: SteveB | last post by:
I'm porting an application from Apache Xerces to .Net and am having a couple of small problems with deserialization. The XML that I'm reading comes from a variety of sources, and there are two...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.