Subject: RE: How do I get the name of the current node From: Don Bruey <dbruey@xxxxxxxxxxxxxxxxxxxxx> Date: Thu, 26 Oct 2000 12:36:58 -0400 |
<xsl:when test="name()='sprogit'"> Consider approaching this a different way - instead of trying to figure out as you go along which element you're dealing with, use apply-templates to do the work (i.e. the "choose" part) for you. Like this <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:apply-templates select="assembly/*" /> </xsl:template> <xsl:template match="sprogit"> <td> <xsl:value-of select="@sku"/> </td><td> 0 </td> <td> <xsl:value-of select="@colour"/></td><td> Hard </td> </xsl:template> <xsl:template match="widget"> <td> <xsl:value-of select="@sku"/> </td> <td><xsl:value-of select="@legs"/> </td><td> grey </td> <td> Hard </td> </xsl:template> <!-- more <xsl:template> here, one for "dofer", etc. --> </xsl:stylesheet> >-----Original Message----- >From: Mike Clarke [mailto:Mike.Clarke@xxxxxxxxxxxxxxxxxx] >Sent: Thursday, October 26, 2000 11:04 AM >To: XSL-List@xxxxxxxxxxxxxxxx >Subject: How do I get the name of the current node >for the XML > ><assembly> > <sprogit sku="180" colour="blue" /> > <dofer sku="094401" kind="fluffy" /> > <sprogit sku="1094" colour="pink" /> > <widget sku="999" legs="5" /> > <dofer sku="000801" kind="crispy" /> ></assembly> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: How do I get the name of the cu, Kay Michael | Thread | proper usage of lotusxsl at the dos, Dave Hollowell |
Re: How do I get the name of the cu, David Carlisle | Date | RE: Saxon and MSXML3 differences, Kay Michael |
Month |