Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-197

xpath with predicates does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Version 2
    • Version 2.4.1
    • None
    • None
    • JDK 1.4.2_08

    Description

      If I use Saxon 8.5.1 with XMLBeans the xpath expression with a simple predicate does not work.

      I tried the example in the documentation on the website:

      <?xml version="1.0" encoding="UTF-8"?>
      <employees>
      <employee>
      <name>Fred Jones</name>
      <address location="home">
      <street>900 Aurora Ave.</street>
      <city>Seattle</city>
      <state>WA</state>
      <zip>98115</zip>
      </address>
      <address location="work">
      <street>2011 152nd Avenue NE</street>
      <city>Redmond</city>
      <state>WA</state>
      <zip>98052</zip>
      </address>
      <phone location="work">(425)555-5665</phone>
      <phone location="home">(206)555-5555</phone>
      <phone location="mobile">(206)555-4321</phone>
      </employee>
      </employees>

      The query I used was:
      $this//phone[@location = 'work']

      I got the error:
      java.lang.RuntimeException: Trying XBeans path engine... Trying Saxon... FAILED on $this//phone[@location='work']
      ...stack trace ....

      However, if I use Saxon 8.1.1 jar as stated in the page, it works OK.

      Attachments

        1. XPathTest.java
          0.9 kB
          Primoz Hrvatin

        Activity

          People

            Unassigned Unassigned
            primozh Primoz Hrvatin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: