XML/XSL newb q: can I ever select or refer to xml attribute values?

Discussion in 'XML' started by 5tein, Apr 29, 2004.

  1. 5tein

    5tein Guest

    I mean, with XSL functions such as SELECT can I only refer to XML
    element values or can I somehow also refer to XML attribute values?
    Is there any way to refer to XML content based on attribute values? Or
    is it a parsed data only thing?

    BTW, new to XML; sorry if this is a dumb question. I just haven't seen
    this explicitly stated anywhere (though by experience it doesn't seem
    to work).
    5tein, Apr 29, 2004
    #1
    1. Advertising

  2. In article <>,
    5tein <> wrote:
    % I mean, with XSL functions such as SELECT can I only refer to XML
    % element values or can I somehow also refer to XML attribute values?

    I hate it when people as questions in the subject line, then don't
    repeat them in the body of the message.

    Select isn't a function -- rather it's an attribute of several
    elements. This attribute always contains an xpath expression,
    so you can refer to anything xpath can refer to.

    As it happens, you can refer to attributes. It's worth reading an
    introduction to xpath, but you can do something like

    <xsl:value-of select='@x'/>

    to get at the value of attribute x of the current node.
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Apr 30, 2004
    #2
    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. Replies:
    1
    Views:
    3,591
    A. Bolmarcich
    May 27, 2005
  2. Kourosh
    Replies:
    6
    Views:
    840
    Peter Flynn
    May 17, 2006
  3. mrstephengross

    Can't refer to base class attribute?

    mrstephengross, Oct 23, 2007, in forum: Python
    Replies:
    1
    Views:
    316
    Marc 'BlackJack' Rintsch
    Oct 23, 2007
  4. Replies:
    21
    Views:
    16,103
    Harlan Messinger
    Dec 14, 2007
  5. Jason
    Replies:
    0
    Views:
    188
    Jason
    Jul 6, 2004
Loading...

Share This Page