xsl-list
[Top] [All Lists]

Re: [xsl] XSL Help

2010-10-06 06:41:02
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. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>