[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to refer to the 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|