[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

retriving attribute values from an element with attrib

Subject: retriving attribute values from an element with attributes
From: msew <msew@xxxxxxxxxxxx>
Date: Thu, 31 May 2001 21:25:43 -0700
xsl match element with attributes
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.