[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Data from DB in xsl
Hi, > on writing the code you gave me, i get the error below: > > "Unexpected character in query string. contains($sText,-->\<--n\n)" > > here is my code: > > <xsl:template name="paragrapher"> > <xsl:param name="sText"/> > <xsl:if test="contains($sText,\n\n)"> > <p> > <xsl:value-of > select="substring-before($sText,\n\n)"/> > </p> > </xsl:if> > </xsl:template> Yes, well, that was pseudo-code - XPath doesn't use \n to denote a LINE FEED character. And you missed the else clause, too. <xsl:template name="paragrapher"> <xsl:param name="sText"/> <xsl:choose> <xsl:when test="contains($sText, '

')"> <p> <xsl:value-of select="substring-before($sText, '

')"/> </p> <xsl:call-template name="paragrapher"> <xsl:with-param name="sText" select="substring-after($sText, '

')" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <p> <xsl:value-of select="$sText"/> </p> </xsl:otherwise> </xsl:choose> </xsl:template> Jarno XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|