Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML/XSL newb q: can I ever select or refer to xml attribute values?

Reply
Thread Tools

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

 
 
5tein
Guest
Posts: n/a
 
      04-29-2004
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).
 
Reply With Quote
 
 
 
 
Patrick TJ McPhee
Guest
Posts: n/a
 
      04-30-2004
In article <(E-Mail Removed) >,
5tein <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to refer to data stored in xml from xml itself? haigang0708@gmail.com XML 6 12-20-2008 02:40 PM
[XSLT] Select node by attribute with value from an attribute of its self Stefan_W XML 1 11-05-2008 10:50 AM
can src attribute of an image tag refer to a unc path? TheUsenetReader@gmail.com HTML 21 12-14-2007 07:42 PM
Can't refer to base class attribute? mrstephengross Python 1 10-23-2007 07:15 PM
Refer to an XML document from within an XML document Manish Hatwalne XML 1 07-13-2004 10:24 AM



Advertisments