Using XML Attributes in an XSLT StyleSheet

  • Thread starter Thread starter One Handed Man \( OHM - Terry Burns \)
  • Start date Start date
O

One Handed Man \( OHM - Terry Burns \)

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
 
Hi again Terry, almost there - try (prefixed by names space if necessary)

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


Hex
 
should read "namespace", not "names space" - silly autocorrect in my mailer
:(
 
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
 
Back
Top