By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,247 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,247 IT Pros & Developers. It's quick & easy.

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

P: n/a
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).
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <f5**************************@posting.google.com >,
5tein <st***@cc.usu.edu> 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
pt**@interlog.com
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.