|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: String manipulation & Line Breaks
Hi. > -----Mensagem original----- > De: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] Em nome de > Marty McKeever > Enviada: terça-feira, 25 de Março de 2003 15:15 > Para: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Assunto: String manipulation & Line Breaks > (...) > > <xsl:call-template name="replace"> > <xsl:with-param name="str" select="bio"/> > <xsl:with-param name="from">\n</xsl:with-param> Here you have to use &_#10; (without the underscore) instead, in XML '\n' is just a string containing 2 chars > <xsl:with-param name="to"><br/></xsl:with-param> </xsl:call-template> You'll have to use a nodeset() function with this parameter. You'll have to check the docs of your xslt processor for that. This stylesheet work as intended to but it will only work with msxml processor. You'll have to add this to your xsl:stylesheet: xmlns:ms="urn:schemas-microsoft-com:xslt" <xsl:template name="replace"> <xsl:param name="str" select="''"/> <xsl:param name="from" select="''"/> <xsl:param name="to"></xsl:param> <xsl:choose> <xsl:when test="contains($str,$from)"> <xsl:value-of select="substring-before($str,$from)"/> <!-- -- this is the part that you'll have to change, depending on your xslt processor --> <xsl:copy-of select="ms:node-set($to)"/> <xsl:call-template name="replace"> <xsl:with-param name="str" select="substring-after($str,$from)"/> <xsl:with-param name="from" select="$from"/> <xsl:with-param name="to" select="$to"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$str"/> </xsl:otherwise> </xsl:choose> </xsl:template> Hope this helps you. 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
|

Cart








