[xsl] Recognizing non-XML Markup Structure

Subject: [xsl] Recognizing non-XML Markup Structure
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Thu, 27 Sep 2007 10:32:51 +0530
First of all I want to thanks all the xslt user who support others by prompt reply.

I am now trying to learn role of regex within XSLT and tried it by the example here


Problem: replace all occurrences of [...] in the para by cite elements, retaining the content between the square brackets as the content of the new element.

<para>Hoping to satisfy [...] the secrets of ecstatic love, the roots of personal happiness.</para>
<xsl:analyze-string select="para" regex="\[(.*?)\]">
<cite>joga<xsl:value-of select="regex-group(1)"/></cite>
<xsl:value-of select="."/>

<xsl:template match="para">
<a><xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute></a>
<p align="justify" style="margin-top:0pt;margin-bottom:0pt"><xsl:apply-templates/></p>

XSL:Analyze-string must not appear directly within xsl:stylesheet


Current Thread