[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: regexp question
On Sep 12, 2004, at 1:58 PM, Michael Kay wrote:
A repetition count in a regex is indicated by curly braces, not square Oops; I should have realized that. Thanks. OK, followup: I'm writing this to take a newspaper xhtml file and clean it up. Within paragraphs, there are just two things I want to do: 1) convert fake quotes to <q> elements, and b) to change graphic dropcaps like this ... <p><img src="http://graphics7.nytimes.com/images/dropcap/m.gif" width="37" height="33" align="left" border="0" alt="M" />OSCOW, ....</p> .... to text. So the below template handles the quotes, but I don't really understand how to get the child xhtml:img template to apply. <xsl:template match="xhtml:p"> <p> <xsl:analyze-string flags="s" select="." regex='"(.*?)"'> <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> Also, is there some reasonably reliable way -- again using xslt 2.0 -- to take this ... <meta name="byl" content="By C. J. CHIVERS and STEVEN LEE MYERS" /> .... and turn it into this: <meta name="author" content="Chivers, C. J." /> <meta name="author" content="Myers, Steven Lee" /> Bruce
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|