[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT 2.0 Matching characters above 255
For something I thought not possible - 2 answers :) I'm guessing the string-to-codepoints() would be much faster, so I'll use that. For the archive (and maybe the FAQ DaveP?): string-to-codepoints(): <xsl:template match="text()"> <xsl:for-each select="string-to-codepoints(.)"> <xsl:choose> <xsl:when test=". > 255"> <span style="font-family:Code2000"> <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> </xsl:template> analyze-string: <xsl:template match="text()"> <xsl:analyze-string select="." regex="[ÿ-]+"> <xsl:matching-substring> <span style="font-family:Code2000"> <xsl:value-of select="."/> </span> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> Thanks David and Mike, andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|