Hi Adam,<div><br></div><div>I'm looking at the formal specification of xpath/xquery:<div><div><p dir="ltr"><a href="http://www.w3.org/TR/xquery-semantics">http://www.w3.org/TR/xquery-semantics</a></p><p dir="ltr">It would really help to start with a function that implements the actual selection in steps. Do you know such a function?</p><p dir="ltr">Thanks,</p><p dir="ltr">Wouter</p></div><div><div>Op dinsdag 26 januari 2016 heeft W.S. Hager <<a href="mailto:wshager@gmail.com">wshager@gmail.com</a>> het volgende geschreven:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Not really, no. But my guess is that the path is not relevant, as its steps simply contain variable names. The proof you want to have is a formal one, and I think it doesn't have to do with the path expression, but rather the formalism it implements.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-26 17:41 GMT+01:00 Adam Retter <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','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">Any chance you could offer me an example? ;-)<br>
<div><div><br>
On 26 January 2016 at 16:40, W.S. Hager <<a href="javascript:_e(%7B%7D,'cvml','wshager@gmail.com');" target="_blank">wshager@gmail.com</a>> wrote:<br>
> Hi Adam,<br>
><br>
> Perhaps it helps to start with rewriting the xpath expressions as pure<br>
> lambda expressions. Maybe that way you could apply lambda calculus?<br>
><br>
> Cheers,<br>
> Wouter<br>
><br>
> 2016-01-26 17:26 GMT+01:00 Adam Retter <<a href="javascript:_e(%7B%7D,'cvml','adam.retter@googlemail.com');" target="_blank">adam.retter@googlemail.com</a>>:<br>
>><br>
>> 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>
>><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="javascript:_e(%7B%7D,'cvml','talk@x-query.com');" target="_blank">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>
><br>
><br>
><br>
><br>
> --<br>
><br>
> W.S. Hager<br>
> Lagua Web Solutions<br>
> <a href="http://lagua.nl" rel="noreferrer" target="_blank">http://lagua.nl</a><br>
<br>
<br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><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>
</blockquote></div></div></div></div><br><br>-- <br><div>
<p> 
W.S. Hager<br>
Lagua Web Solutions<br>
<a href="http://lagua.nl/" target="_blank">http://lagua.nl</a><br></p></div><br>