bravesoftdz / omnixml

Automatically exported from code.google.com/p/omnixml
0 stars 0 forks source link

XPath predicates - cannot contain forward slashes? #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
For the attached XML, the XPath expression with the following predicate works:
  //link:presentationLink[@xlink:role="funny"]

However, if the predicate contains a string with forward slashes, a syntax 
error occurs:
//link:presentationLink[@xlink:role="www.google.com/testing]

Is there any chance that this might get fixed?

<?xml version="1.0" encoding="UTF-8"?>
<link:linkbase xmlns:link="linking_namespace" xmlns:xlink="xlinking_namespace">
  <link:presentationLink xlink:role="fancy">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="www.google.com/testing">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="funny">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
</link:linkbase>

Original issue reported on code.google.com by o_weinm...@yahoo.com on 25 Jul 2013 at 10:09

GoogleCodeExporter commented 8 years ago
> role="www.google.com/testing]

there is no ending quote

Original comment by Arioch...@gmail.com on 9 Dec 2014 at 3:48

GoogleCodeExporter commented 8 years ago
Fails even with the ending quote.

Simpler Test Case XML:

<root><a>hello</a><a r="/e">bye</a></root>

XPath expression

//a[@r="/e"]

Should select the second a element, but instead fails with EXMLXPath: Invalid 
syntax at position 14

Original comment by zar...@gmail.com on 19 Mar 2015 at 2:36