0

The expression /bookstore/book[1]/title should return <title lang="eng">Harry Potter</title> but instead I get "The regular expression does not match..."

Here is my XML that I am testing:

<?xml version="1.0" encoding="ISO-8859-1"?>

<bookstore>

<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="eng">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore> 

enter image description here

Ura
  • 2,173
  • 3
  • 24
  • 41
  • RegexBuddy is for developing/testing regular expressions, not doing XPath searches or filtering. In addition, you say "This should return", but you don't say anything about what "this" might be. – Ken White Oct 23 '12 at 19:44
  • What does XPath in the drop-down allow me to do? – Ura Oct 23 '12 at 19:51
  • 1
    I removed my last comment, because RegexBuddy3 does include `XPath` in the drop-down list of languages on the `Use` tab. However, since you've posted no XML to use to try and match against, it's pretty hard to say what might be wrong. The `Help->Tools and Languages` menu item takes you to `Tools and Languages` in the help file, which has a whole section on `XQuery and XPath`. – Ken White Oct 23 '12 at 19:56
  • My suspicion is that it takes very simple regular expressions and tries to convert them to their xPath equivalent; however, xPath is very limited syntax-wise. The documentation I pointed you to in my last comment should help. – Ken White Oct 23 '12 at 20:09
  • I saw the documentation but still no luck. Under "Use" tab I see `fn:matches($input, "/bookstore/book[1]/title", "i")`, then I go back to "Test" tab and no matches. – Ura Oct 23 '12 at 20:15
  • You might have better luck asking in the RegexBuddy discussion forums. There's a tab in the app itself that will take you there directly from within RegexBuddy. – Ken White Oct 23 '12 at 20:20

1 Answers1

0

While RB can handle regular expressions for XPath, but it doesn't handle XPath paths. For constructing/checking what's selected etc of XPath paths you'd need something like XPath Explorer, Firefox with Firebug+Firepath, or similar.

Ura
  • 2,173
  • 3
  • 24
  • 41