Subject: RE: Re: UTF characters
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 31 Mar 2010 15:02:06 +0100
|
> Here is an example of the query asked earlier, suppose I have two
> paragraphs:
>
> PARA1: <p>INTRODUCTION- This is plain text</p>
> PARA2: <p>INTRODUCTION- This is text with UTF character 'Y </p>
>
> AND if write something like:
> <xsl:template match="p">
> <xsl:if test="contains(text(),'INTRODUCTION')">
> <!--do something-->
> </xsl:if>
> </xsl:template>
It seems you are using "UTF" to mean an "unusual" character, in some sense
of the word.
Try:
<xsl:if test="matches(text(), '\P{IsBasicLatin}')">
However, it would be nice to know what you want to do differently if this
condition is true. If we knew, we might be able to suggest a better
approach.
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
|