Subject: RE: [xsl] Printing all child bachelor nodes From: cknell@xxxxxxxxxx Date: Thu, 09 Feb 2006 10:43:46 -0500 |
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" indent="yes" /> <xsl:strip-space elements="*" />
<xsl:template match="/"> <xsl:apply-templates /> </xsl:template>
<xsl:template match="features"> <xsl:apply-templates /> </xsl:template>
<xsl:template match="*[not(local-name()='features')]"> <xsl:value-of select="local-name()" /> <xsl:choose> <xsl:when test="count(@*) = 0"><xsl:text>
</xsl:text></xsl:when> <xsl:otherwise><xsl:text>:	</xsl:text></xsl:otherwise> </xsl:choose> <xsl:apply-templates select="@*" /> </xsl:template>
<xsl:template match="@*"> <xsl:value-of select="local-name()" /><xsl:text>:</xsl:text><xsl:value-of select="." /> <xsl:if test="not(position() = last())"><xsl:text>	</xsl:text></xsl:if> <xsl:if test="position() = last()"><xsl:text>
</xsl:text></xsl:if> </xsl:template>
</xsl:stylesheet> -- Charles Knell cknell@xxxxxxxxxx - email
-----Original Message----- From: Douglas F Shearer <dougal.s@xxxxxxxxx> Sent: Thu, 9 Feb 2006 15:08:59 +0000 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Printing all child bachelor nodes
********** XML ************ <features> <pool length="30" max-depth="160" min-depth="30" indoor="false"/> <DVD/> <beds twin="2" sofa-bed="1"/> </features>
******** REQUIRED OUTPUT ****** pool: length: 30, max-depth:160, min-depth:30, indoor: false. DVD. beds: twin:2, sofa-bed:1
Douglas F Shearer dougal.s@xxxxxxxxx http://douglasfshearer.dyndns.org
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Printing all child bachel, Jon Gorman | Thread | [xsl] help with select, Jiang, Peiyun |
Re: [xsl] Printing all child bachel, Douglas F Shearer | Date | Re: [xsl] Printing all child bachel, Douglas F Shearer |
Month |