Subject: Re: [xsl] avoiding assignment statements From: "Sam Carleton" <scarleton@xxxxxxxxxxxxxxxx> Date: Fri, 8 Dec 2006 09:56:52 -0500 |
xslt works rather better if you have structured input rather than a fixed set of flat variables. If you had a parameter show that took a list of elements say <Replicates/><Metadata/> then you could just do <xsl:for-each select="$show"> <xsl:if test="position()!=1">, </xsl:if> <xsl:apply-templates select="."/> </xsl:for-each>
I tried it in the main XSLT and it wasn't working so I thought I would put it into a very simply XSLT file so that it was the only thing that happens and I simply cannot get it to work. What am I missing? Here is the simple XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/"> <xsl:for-each select="$show"> <xsl:if test="position()!=1">, </xsl:if> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:template>
<xsl:template match="showReplicates"> Reps </xsl:template>
<xsl:template match="showMetadata"> Meta-Data </xsl:template>
<xsl:template match="showElectronicSignature"> Signature </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] avoiding assignment state, Sam Carleton | Thread | RE: [xsl] avoiding assignment state, Michael Kay |
Re: [xsl] avoiding assignment state, Sam Carleton | Date | RE: [xsl] avoiding assignment state, Michael Kay |
Month |