XSL outputting attribute value in select="" clause?

Discussion in 'XML' started by cephelo@gmail.com, Jun 15, 2006.

  1. Guest

    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
     
    , Jun 15, 2006
    #1
    1. Advertising

  2. Joris Gillis Guest

    On Thu, 15 Jun 2006 06:55:15 +0200, <> wrote:

    > <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'...


    --
    Joris Gillis (http://users.telenet.be/root-jg/me.html)
    Fiat W3C in tenebris
     
    Joris Gillis, Jun 15, 2006
    #2
    1. Advertising

  3. Guest

    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!

    Joris Gillis wrote:
    > On Thu, 15 Jun 2006 06:55:15 +0200, <> wrote:
    >
    > > <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'...
    >
    >
    > --
    > Joris Gillis (http://users.telenet.be/root-jg/me.html)
    > Fiat W3C in tenebris
     
    , Jun 16, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=
    Replies:
    6
    Views:
    13,397
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Apr 4, 2006
  2. Replies:
    1
    Views:
    2,798
    Joris Gillis
    Sep 19, 2005
  3. Replies:
    1
    Views:
    478
    Peter Flynn
    Jan 28, 2006
  4. Kourosh
    Replies:
    6
    Views:
    872
    Peter Flynn
    May 17, 2006
  5. Stefan_W
    Replies:
    1
    Views:
    8,374
    Stefan_W
    Nov 5, 2008
Loading...

Share This Page