Subject: [xsl] Putting characters in an element From: Harm Kok <h.kok@xxxxxxxxxxxxxxx> Date: Thu, 02 Oct 2003 14:47:54 +0200 |
input: <?xml version="1.0"?> <root> <al>1. This is some very <emphasis>important</emphasis> tekst.</al> <al>2. And a second line</al> <al>And a last line</al> </root>
Stylesheet: <xsl:template match="al"> <xsl:param name="first-string"> <xsl:value-of select="substring-before(., ' ')"/> </xsl:param>
<xsl:choose> <xsl:when test="matches($first-string,'\d')"> <li> <xsl:analyze-string select="." regex="^\d\. "> <xsl:matching-substring> <nr><xsl:value-of select="."/></nr> </xsl:matching-substring> <xsl:non-matching-substring> <al><xsl:copy-of select="."/> </al> </xsl:non-matching-substring> </xsl:analyze-string> </li> </xsl:when> <xsl:otherwise> <al><xsl:copy-of select="descendant::node()"/></al> </xsl:otherwise> </xsl:choose> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Making picture "clickable, Andreas L. Delmelle | Thread | Re: [xsl] Putting characters in an , David Carlisle |
[xsl] Re: xsl--accessing a speciic , Dimitre Novatchev | Date | RE: [xsl] Parameter problem, Americo Albuquerque |
Month |