XSL outputting attribute value in select="" clause?

C

cephelo

I have no problems outputting the attribute value when the node is in
context, for example, @id when an <status> node is in context.

However, I am having trouble outputting it in a <xsl:value-of />
element:

<xsl:value-of select="procresults/settings@priority />

where it looks like

<procresults>
<settings priority="3" />
</procresults>

I looked through the XPath spec and didn't see anything regarding it,
I've tried using :node() and a few other modifiers with no luck.

Googling doesn't do much good as most articles are talking about the
select="" being an attribute to output instead of using select="" to
output an attribute.

Thanks for any tips,

Eric
 
J

Joris Gillis

<xsl:value-of select="procresults/settings@priority />

Mind the slash;-)
<xsl:value-of select="procresults/settings/@priority" />

Of course, this would only work when the context node is the parent of
'procresults'...
 
C

cephelo

Thanks! I did try that but some of the .NET xslt errors are quite
cryptic, it was a problem elsewhere in my document as well, woops!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top