[xquery-talk] xpath1 text node contains attribute, equivalent in xpath2
inpost at gmail.com
Fri Dec 27 10:07:30 PST 2013
On 27/12/2013, Misztur, Chris <CMisztur at macleanfogg.com> wrote:
> Imagine that query  is actually doing a for-each loop on each <title/>
> and the predicate in square brackets is applying a 'where' statement on each
> iteration. You can also rewrite query  as query .
The 'let' clause was chosen because it was not considered necessary to
perform any multiple iterations, just a single search for the target.
Is this an incorrect thought-process?
>  for $book-title in doc('xmldatabasefile.xml')/bookstore/book/title
> Where contains($book-title/text(), 'Learning XML')
> Return $book-title/text()
This is understood, but the request was also to retrieve the text
nodes of the parent (and parent siblings - uncles/aunts? or maybe
referred to as sibling text nodes? ;) ) elements, i.e.:
Erik T. Ray
I am unable to append sucessfully '/parent::*' to the 'for' statement above.
More information about the talk