Re: [xsl] XSL Help

Subject: Re: [xsl] XSL Help
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 06 Oct 2010 12:40:51 +0100
On 06/10/2010 12:33, chirag matkar wrote:
Hello ,
I have to tag the entities within text dot,comma,hyphen,semicolon,etc .
How can i achieve this?
--
Regards,
Chirag Matkar

Your subject line isn't very distinctive given the subject of this mailing list, an it's quite hard to tell what transformation you are trying to do from your description.

please see the posting guidelines for the list.

perhaps you want to put an element around punctuation characters

turning

<text>this, that; and the other!</text>

into

<text>this<punct>,</punct> that<punct>;</punct> and the other<punct>!</punct></text>

If so, and you are using xslt 2 then

<xsl:template match="text">
<xsl:analyze-substring select="." regexp="['.;!,]">
<xsl:matching-substring><punct><xsl:value-of select="."/></punct></xsl;matching-substring>
<xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>


If that isn't what you meant, you'll need to ask again with a clearer question.

David




________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread