[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Recognizing non-XML Markup Structure

Subject: Recognizing non-XML Markup Structure
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Thu, 27 Sep 2007 10:32:51 +0530
 Recognizing non-XML Markup Structure
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

http://www.w3.org/TR/xslt20/#function-regex-group

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.

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


<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:template>


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

thanks
...JSR

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.