Re: [xsl] regexs, grouping (?) and XSLT2?

Subject: Re: [xsl] regexs, grouping (?) and XSLT2?
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sat, 7 Aug 2004 21:37:31 -0400
On Aug 7, 2004, at 3:43 PM, Bruce D'Arcus wrote:

I have paragraphs like:

<p>A "quote."</p>

I want the quotes converted to XHTML tags. The following code doesn't work, or did any other variation I tried:

I figured out this part:


<xsl:template match="xhtml:p">
  <p>
    <xsl:analyze-string select="." regex='"(.*?|.*?\n.*?)"'>
      <xsl:matching-substring>
	<q><xsl:value-of select="regex-group(1)"/></q>
      </xsl:matching-substring>
      <xsl:non-matching-substring>
	<xsl:value-of select="."/>
      </xsl:non-matching-substring>
    </xsl:analyze-string>
  </p>
</xsl:template>

Bruce

Current Thread