This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
retriving attribute values from an element with attributes
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] retriving attribute values from an element with attributes
- From: msew <msew at mail dot ev1 dot net>
- Date: Thu, 31 May 2001 21:25:43 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi!
What is the xsl code to retrieve a specific attribute's value from an element.
ie <FOO attr0="bar" attr1="baz" >
some data
</FOO>
I know how to get out the attributes if FOO is an attribute but I desire
to have FOO be an ELEMENT and to have attributes that are FOO's meta data.
I know one could take all of the attrs and make them child elements, but
this seems semi odd for all cases.
Also: Does anyone have a couple of urls to some uber xsl sites with lots
of examples and tutorials on things people actually use. (ie most of the
tutorials on any topic are just the obvious things but totally break down
on the semi complicated stuff that we all want to do).
thanks!
msew
specific example:
I have this XML:
<BARTLES_FOUR>
<BARTLE_TYPE NAME="achiever">
Gaining access to all of the avatars.
</BARTLE_TYPE>
<BARTLE_TYPE NAME="explorer">
Finding how the avatars are unlocked.
</BARTLE_TYPE>
<BARTLE_TYPE NAME="killer">
?
</BARTLE_TYPE>
<BARTLE_TYPE NAME="socializer">
using avatars in chat, having avatar do actions in chat
</BARTLE_TYPE>
</BARTLES_FOUR>
I have these xsl templates
<xsl:template match="BARTLES_FOUR">
<TR>
<TD CLASS="SECTION_HEADING">
BARTLES FOUR
</TD>
</TR>
<TR>
<TD>
<xsl:apply-templates/>
</TD>
</TR>
<TR>
<TD>
<BR></BR>
</TD>
</TR>
</xsl:template>
<xsl:template match="BARTLE_TYPE">
<TR>
<TD>
???????????? What to stick here to get out the NAME attribute
?????????
</TD>
</TR>
<TR>
<TD>
<xsl:apply-templates/>
</TD>
</TR>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list