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

Re: How to refer to the tag name

Subject: Re: How to refer to the tag name
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Mon, 16 Jul 2001 14:41:34 +0100
change row tag name
u may use the name() function to get the name of the current node

cheers, jim fuller
----- Original Message ----- 
From: "Lajos Moczar" <lmocz@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, July 16, 2001 2:33 PM
Subject:  How to refer to the tag name


> Hi all. I think (hope!) this is a simple question ...
> 
> I have a stylesheet in which I want to refer to the tag name, not the 
> tag contents. My XML is built dynamically as a result of a database 
> query and looks like this:
> 
> <row>
>   <id>1</id>
>   <name>Tom</name>
>   <dob>19800322</dob>
> </row>
> <row>
>    ...
> </row>
> 
> I simply want to build column headers based on the names of the column 
> tags - id, name, dob. So I have a template rule to match the first 
> occurance of <row>:
> 
> <xsl:template match="row[position()=1]">
>    <tr bgcolor="#666699">
>      <xsl:for-each select="*">
>       <td class="base-text"><font color="#FFFFFF"><center><b>
>        <!-- What goes here? -->
>       </b></center></font></td>
>      </xsl:for-each>
>    </tr>
>    <tr>
>      <xsl:apply-templates/>
>    </tr>
> </xsl:template>
> 
> 
> All I need is to get the name of each child tag of the row element as I 
> loop through with <xsl:for-each>. Any ideas?
> 
> Thanks in advance.
> 
> Lajos Moczar
> galatea.com
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.