Subject: [xsl] xsl:analyze-string problem From: Yves Forkl <Y.Forkl@xxxxxx> Date: Thu, 08 Feb 2007 17:47:58 +0100 |
1) <e> def ghi</e> 2) <e> abc 22 def 3 ghi 1. </e> 3) <e> 2. </e> 4) <e> 3. def 35 78 ghi </e>
1) just some words and/or numbers 2) like 1), but followed by a number and a period 3) just a number and a period 4) like 3), but followed by some words and/or numbers
<xsl:for-each select="regex-group(1)"> <xsl:call-template name="create_element_and_space"> <xsl:with-param name="new_element_name" select="'text'"/> </xsl:call-template> </xsl:for-each>
<xsl:for-each select="regex-group(2)"> <xsl:call-template name="create_element_and_space"> <xsl:with-param name="new_element_name" select="'ordinal'"/> </xsl:call-template> </xsl:for-each>
<xsl:for-each select="regex-group(3)"> <xsl:call-template name="create_element_and_space"> <xsl:with-param name="new_element_name" select="'text'"/> </xsl:call-template> </xsl:for-each>
<!-- helper template for squeezing spaces out into mixed content --> <xsl:template name="create_element_and_space"> <xsl:param name="new_element_name"/>
<xsl:matching-substring> <xsl:value-of select="."/> </xsl:matching-substring>
<xsl:non-matching-substring> <xsl:element name="{$new_element_name}"> <xsl:value-of select="."/> </xsl:element> </xsl:non-matching-substring>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] [ANN] Wiki for XSLT, XPath an, Abel Braaksma | Thread | RE: [xsl] xsl:analyze-string proble, Michael Kay |
RE: [xsl] Newbie question on XSL tr, Michael Kay | Date | RE: [xsl] xsl:analyze-string proble, Michael Kay |
Month |