Newbies Intrigued Posted July 28, 2003 Newbies Posted July 28, 2003 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>
beverly Posted August 1, 2003 Posted August 1, 2003 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).
Recommended Posts
This topic is 7783 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now