| 
 
Subject: Re: [xsl] Replacing character entities From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Mon, 14 Feb 2005 19:38:30 +0100  | 
Hi,I have a text block that contains 
 
 wherever the user wanted it to look like a paragraph break. I don't any have control over the input.
Any ideas on how can I replace 
 with <br/>? Or better still, use the 
 to identify the paragraphs and wrap each <p>paragraph</p>?
And the desired output would be: <div> <p>Line1</p> <p>Line2</p> <p>other content</p> </div>
<xsl:template match="text"> <div> <xsl:call-template name="par"/> </div> </xsl:template>
<xsl:template name="par"> <xsl:param name="text" select="."/> <p> <xsl:value-of select="substring-before(concat($text,'
'),'
')"/> </p> <xsl:if test="contains($text,'
')"> <xsl:call-template name="par"> <xsl:with-param name="text"> <xsl:value-of select="substring-after($text,'
')"/> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) "Scio me nihil scire" - Socrates
| Current Thread | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| [xsl] Replacing character entities, Wagstaff, Jason | Thread | Re: [xsl] Replacing character entit, Wagstaff, Jason | 
| RE: [xsl] xsl:function, arithmetic, Michael Kay | Date | Re: [xsl] Understanding Identity Tr, Karl Stubsjoen | 
| Month |