Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2008, 01:28 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Regular expression to match ÿ using saxon

I'm struggling with something that should be trivial: I'm using Saxon 9 and processing text and want to match a character of arbitrary value such as 255 in a regular expression. I just can't figure out how to express it!

I'm trying something like <xsl:analyze-string select="$text" regex="blah([^#xff]*)blah">. I've tried stuff like \u and \x without any luck.

So far the only successful solution I've found is to find the printable unicode character, like 'ÿ' for 0xFF and copy-paste it into my XSLT.

How am I supposed to do this with XPath 2.0 or saxon or whatever is constraining me from using the multi-character escapes I know from other dialects of regular expressions?

Ian

 
Old February 28th, 2008, 04:26 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use & # x f f ; (without the spaces) just as you would anywhere else in an XML document where you need to write a special character. The only restriction is that you can't use characters that aren't allowed in XML.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression MunishBhatia ASP.NET 2.0 Professional 5 May 22nd, 2007 07:59 AM
Match accented characters with a regular expr. dacian PHP How-To 0 February 22nd, 2007 09:54 AM
regular expression Moharo Pro PHP 3 April 30th, 2004 04:44 AM
Regular Expression Help Hadware .NET Web Services 3 November 4th, 2003 10:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.