[xquery-talk] retrieving node depending on its context

Michael Kay mhk at mhk.me.uk
Sun May 8 15:49:22 PDT 2005


if (tokenize(../node()[. >> $n][1][self::text()], '\s')[1] eq 'and')

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of Christian Wittern
> Sent: 08 May 2005 13:48
> To: talk at xquery.com
> Subject: [xquery-talk] retrieving node depending on its context
> 
> 
> Dear XQuery users,
> 
> Having tried to solve the following problem without success for a
> while, I  would be grateful for any pointers or advice:
> 
> Given sample data like the following:
> 
> <p>His name was <name>Christian</name> and he lived in
> <place>Kyoto</place>.</p>
> 
> I would like to retrieve with XQuery the "<name>" node based on the
> content of the following text, e.g. for example only if the <name> is
> followed by a text node that starts with the word "and".  
> 
> I would like to avoid using following or following-sibling and assume
> I would have to use "<<" and ">>", but I can't think of how to do
> that.
> 
> Any help appreciated,
> 
> Chris
> 
> -- 
> 
>  Christian Wittern 
>  Institute for Research in Humanities, Kyoto University
>  47 Higashiogura-cho, Kitashirakawa, Sakyo-ku, Kyoto 606-8265, JAPAN
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> 




More information about the talk mailing list