[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT 2.0 matches function (Saxon)

Subject: RE: [xsl] XSLT 2.0 matches function (Saxon)
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 8 Aug 2005 08:47:55 +0100
forx0002
> I thought I was making some stupid mistake evident to anyone but me.

Well, if you can't spot the error with the diagnostics in front of you, then
it's unlikely other people will be able to spot it without...
 
> Here's the err msg:
> 
> Error at xsl:value-of on line 18 of 
> file:/F:/Dane/tymczas/xliff/saxon/segment.xsl:
>    FORX0002: net.sf.saxon.type.RegexTranslator$RegexSyntaxException: 
> Error at character 2 in regular expression: bad escape sequence

Good, that immediately eliminates lots of possibilities.
> 
> I got no error on using quotes around $before but then I got "false" 
> everytime in the output as nothing matched (and it should, given the 
> contents of beforebreak).

You mean you tried matches(...., '$before')? That would match any string
that contains the characters "before" after the end of the string....

> 
> > You haven't given any evidence that the 
> select="beforebreak" is actually
> > selecting the element you've shown.
> 
> I checked that with a template:
> 
> <xsl:template match="//rule[@break='yes']">
>    <xsl:variable name="before" select="beforebreak"/>
>    <xsl:value-of select="$before"/>
>    <!-- xsl:value-of select='matches($segmented_file//Raw, 
> $before)'/ -->
>      <xsl:apply-templates/>
>    </xsl:template>
> 
> 
> And I got the content of it in the output (I've five <rule> elements, 
> and three of them have beforebreak filled in, so it got concatenated):
> 
> <?xml version="1.0" 
> encoding="UTF-8"?>[\.\?!]+[\.\?!]+[\xff61\x3002\xff0e\xff1f\xff01]+
> 
> Does this sound like evidence?
> 

Absolutely. You said that $before contained "[\.\?!]+" and this shows that
it doesn't. There's some garbage in here, you need to find out where it came
from. \xff61 is not valid in an XPath regular expression.

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.