Subject: Re: [xsl] Transform symbol to element From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Wed, 11 Nov 2009 12:36:20 +0100 |
This is possible to convert the quote symbol to xml elements?
If anybody know the way please share me, below placed my input file format
and required output format.
Input XML:
<p>This is the sample of double quote starting the double publication ended</p> <p>This is the sample of single quote starting the single publication ended</p>
Output XML:
<para>This is the sample of double quote starting <quote open="" close="">the double publication</quote> ended</para> <para>This is the sample of single quote starting <quote open="" close="">the single publication</quote> ended</para>
<xsl:template match="p"> <para> <xsl:analyze-string select="." regex="()([^]*)()|()([^]*)()"> <xsl:matching-substring> <quote open="{regex-group(1)}" close="{regex-group(3)}"> <xsl:value-of select="regex-group(2)"/> </quote> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </para> </xsl:template>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Transform symbol to element, Selvaganesh | Thread | Re: [xsl] Transform symbol to eleme, Syd Bauman |
[xsl] Transform symbol to element, Selvaganesh | Date | Re: [xsl] Transform symbol to eleme, Syd Bauman |
Month |