Re: [xsl] Regex Expression Problem

Subject: Re: [xsl] Regex Expression Problem
From: Alexey Nickolaenkov <nikolaenkov@xxxxxxxxxxxx>
Date: Wed, 24 Jan 2007 14:12:08 +0300
Hi Byomokesh
The using regex here is too heavy here. You need something like
tokenize().

Wednesday, January 24, 2007, 1:57:20 PM, you wrote:

B> Hi All,

B> I am facing Regex problem. Here is my input, output and Stylesheet.

B> My Input
B> =======

B> <P>Todo pasa y todo queda,
B>   pero lo nuestro es pasar,
B>   pasar haciendo caminos,
B>   caminos sobre el mar.
B>   
B>   Nunca persequ la gloria,
B>   ni dejar en la memoria
B>   de los hombres mi canci&#243;n;
B>   yo amo los mundos sutiles,
B>   ingrvidos y gentiles,
B>   como pompas de jabn.
B> </P>

B> I Need Output
B> =============

B> <poem>
B> <stanza>
B> <line>Todo pasa y todo queda,</line>
B> <line>pero lo nuestro es pasar,</line>
B> <line>pasar haciendo caminos,</line>
B> <line>caminos sobre el mar.</line>
B> </stanza>
B> <stanza>  
B>  <line>Nunca persequ la gloria,</line>
B>   <line>ni dejar en la memoria</line>
B>   <line>de los hombres mi cancin;</line>
B>  <line> yo amo los mundos sutiles, </line>
B>  <line> ingrvidos y gentiles, </line>
B>  <line> como pompas de jabn. </line>
B> </stanza>
B> </poem>

B> My XSL
B> ======

B> <xsl:template match="P">
B> <xsl:analyze-string select="." regex="[^-a-z]+.[a-z]&#10;">
B>   <xsl:matching-substring>
B> <line>
B>     <xsl:value-of select="."/>
B> </line>
B>   </xsl:matching-substring>
B>   <xsl:non-matching-substring>
B>     <xsl:value-of select="."/>
B>   </xsl:non-matching-substring>
B> </xsl:analyze-string>
B>   </xsl:template>


B> My output is not properly. I am missing in regex expression. Please any
B> advice how catch every line and enter space.

B> Thanks and Regards
B> Byomokesh


-- 
Alexey                            mailto:nikolaenkov@xxxxxxxxxxxx

Current Thread