bug in processing XPATH with this simple regular expression?

Monday, 17 June 2013 · 2 messages
II
Imbuter Imb17 Jun 2013 22:23 #

Take this input: <div id="ps-content">foobar</div>

and apply this XPATH 2+: //div[matches(@id,"^s-content$")]

In BaseX command-line it matched! despite the fact that "^" in regex language means "the start of the string".

With Saxon and Xidel command-line it correctly doesn't match. Why does it match in BaseX?

CG
Christian Grün17 Jun 2013 22:33 #

Thanks for your mail.

Quoted text · Imbuter Imb · 5 lines
> Take this input: > <div id="ps-content">foobar</div> > > and apply this XPATH 2+: > //div[matches(@id,"^s-content$")]

I just tried the following query..

  <div id="ps-content">foobar</div>[matches(@id,"^s-content$")]

..and I got no result. Which BaseX version are you working with? Can you give us some more details?

Christian


⚡Generated with XQuery