<div dir="ltr"><div><div>Hi Adam,<br><br></div>Perhaps it helps to start with rewriting the xpath expressions as pure lambda expressions. Maybe that way you could apply lambda calculus?<br><br></div><div>Cheers,<br></div>Wouter<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-26 17:26 GMT+01:00 Adam Retter <span dir="ltr"><<a href="mailto:adam.retter@googlemail.com" target="_blank">adam.retter@googlemail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Given two simple XPaths, say:<br>
<br>
1. //w<br>
<br>
2. /x/y/z/w[@a = 'v']<br>
<br>
As a human I can very easily tell without evaluating the expressions<br>
that (2) will return a subset (or the same set) of the results that<br>
(1) would return *should* they both be evaluated.<br>
<br>
My goal here is given any two simple arbitrary XPaths expressed as<br>
strings, and without evaluating them against a context, to determine<br>
whether one would return a subset of the results of the other.<br>
<br>
I wondered if there might be an algorithm or library that someone<br>
already had or has written which might be able to give me the answer?<br>
<br>
I realise that I can only probably cover a subset of XPath itself, but<br>
it is only the path steps with predicates which I am interested in.<br>
<br>
Ideally I am looking for something in Java.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Adam Retter<br>
<br>
skype: adam.retter<br>
tweet: adamretter<br>
<a href="http://www.adamretter.org.uk" rel="noreferrer" target="_blank">http://www.adamretter.org.uk</a><br>
_______________________________________________<br>
<a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
<a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/listinfo/talk</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div>
<p> 
W.S. Hager<br>
Lagua Web Solutions<br>
<a href="http://lagua.nl/" target="_blank">http://lagua.nl</a><br></p></div></div>
</div>