Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.text.xml > #852

Re: xpath deeper level but considering siblings

Newsgroups comp.text.xml
Date 2016-02-16 09:16 -0800
References <7e34c25e-3db7-4eaa-a4a1-94779ff87b2a@googlegroups.com> <n9vib1$2anh$3@macpro.inf.ed.ac.uk>
Message-ID <54d935fd-e3d8-4efd-bd6b-c0e99212407d@googlegroups.com> (permalink)
Subject Re: xpath deeper level but considering siblings
From frank67x@gmail.com

Show all headers | View raw


Am Dienstag, 16. Februar 2016 17:25:04 UTC+1 schrieb Richard Tobin:
> In article <7e34c25e-3db7-4eaa-a4a1-94779ff87b2a@googlegroups.com>,
>  <frank67x@gmail.com> wrote:
> >What's the xpath to retrieve the value of 
> >  /root/main/data/data1 
> >of the 1st section, where sibling 
> >  /root/main/info[@name='info1'] has value 'value_1a'?
> 
> You want the data/data1 of the root/main whose info[@name="info_1"]
> is equal to "value_1a":
> 
> /root/main[info[@name="info_1"]="value_1a"]/data/data1
> 
> -- Richard

- thanks a lot.

Two next questions:

1) Is it really "info_1" to use? or does it have to be 'info_1'?
(double quote or single quote)

2) Is it also supported to use a combination of criterions?
Something like e.g.: 

/root/main[info[@name="info_1"]="value_1a"]&&[@name="info_2"]="value_2a"]/data/data1

Are logical operators supported? (&& above)

regards,
Frank

Back to comp.text.xml | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

xpath deeper level but considering siblings frank67x@gmail.com - 2016-02-16 02:23 -0800
  Re: xpath deeper level but considering siblings richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-02-16 16:21 +0000
    Re: xpath deeper level but considering siblings frank67x@gmail.com - 2016-02-16 09:16 -0800
      Re: xpath deeper level but considering siblings richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-02-17 01:01 +0000
        Re: xpath deeper level but considering siblings frank67x@gmail.com - 2016-02-17 00:07 -0800
        Re: xpath deeper level but considering siblings Peter Flynn <peter@silmaril.ie> - 2016-02-21 15:41 +0000

csiph-web