xsl-list
[Top] [All Lists]

RE: XSLT 2.0 Matching characters above 255

2005-03-01 07:53:55
You could use 

<xsl:for-each select="string-to-codepoints(.)"
  <xsl:choose>
    <xsl:when test=". > 255">
      <span><xsl:value-of select="codepoints-to-string(.)"/></span>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="codepoints-to-string(.)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:for-each>

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Andrew Welch [mailto:ajwelch(_at_)piper-group(_dot_)com] 
Sent: 01 March 2005 14:33
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] XSLT 2.0 Matching characters above 255



Hi,

I would like to wrap any characters above 255 in <span> tags.  I'm not
sure it's possible...

For this input XML:

<root>
  <entry>A &#120514; BCD &#120515; EFG &#120516; </entry>
</root>

The required output is:

<root>
  <entry>A <span>&#120514;</span> BCD <span>&#120515;</span> EFG
<span>&#120516;</span> </entry>
</root>

I thought about using <xsl:analyze-string>, can regex's can do
comparisons like this?

thanks
andrew

--~------------------------------------------------------------------
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>
--~--





--~------------------------------------------------------------------
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>
--~--