July 28, 200322 yr Newbies Hi everyone, I'm hoping that someone can tell me how to use a line break in xsl. I have tried various code, but it only generates errors. Here is my code... <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" result-ns=""> <xsl:template match="/"><xsl:apply-templates select="SQL/Result" order-by="@StockNumber"/></xsl:template> <xsl:template match="Result"> <OPTION> <xsl:choose> <xsl:when test=".[TempStockOut='Y']"> <xsl:choose> <xsl:when test=".[stockIDAndDescription='Y']"> <xsl:attribute name="value"><xsl:value-of select="ItemID"/></xsl:attribute><xsl:value-of select="StockNumber"/> (<xsl:value-of select="DescriptiveName"/>) $<xsl:value-of select="JewellerPrice"/> [sold Out] </xsl:when> <xsl:otherwise> <xsl:attribute name="value"><xsl:value-of select="ItemID"/></xsl:attribute><xsl:value-of select="StockNumber"/> $<xsl:value-of select="JewellerPrice"/> [sold Out] </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test=".[stockIDAndDescription='Y']"> <xsl:attribute name="value"><xsl:value-of select="ItemID"/></xsl:attribute><xsl:value-of select="StockNumber"/> (<xsl:value-of select="DescriptiveName"/>) $<xsl:value-of select="JewellerPrice"/> <xsl:attribute name="newline"><xsl:value-of select="newline"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="value"><xsl:value-of select="ItemID"/></xsl:attribute><xsl:value-of select="StockNumber"/> $<xsl:value-of select="JewellerPrice"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </OPTION> </xsl:template> </xsl:stylesheet>
August 1, 200322 yr You can type the code with line breaks, but if you are having difficulties making the stylesheet work with the line breaks, remove them. My text editor will "optimize" the code (remove the line breaks).
Create an account or sign in to comment