Hi all,
What does something like [/a/b] mean in an XPath query like /c/d[/a/
b] ?
If I am not wrong, /c/d[./a/b] means return all d elements that their
parent is c and their grand parent is the root element and have a
child that is a and their a child has a child b. But I don't know when
we don't use an expression that starts with ./ or .// in a predicate
and instead use an epxression that starts with / or // what it would
mean.
Does /c/d[/a], for example, mean return all d elements that have a
parent (c with a parent root) only if the root has a child a?
Thanks in advance. 5 2683
Altu schrieb:
Does /c/d[/a], for example, mean return all d elements that have a
parent (c with a parent root) only if the root has a child a?
Yes, but the root is either c or a. So the XPath expression does not
select anything.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Johannes Koch schrieb:
Altu schrieb:
>Does /c/d[/a], for example, mean return all d elements that have a parent (c with a parent root) only if the root has a child a?
Yes, but the root is either c or a.
I mean the root _element_.
So the XPath expression does not
select anything.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Hi Johannes,
Thanks for the reply. Also what is the meaning of multiple consequtive
filters like
a[p1][p2][p2]
Does it mean a elements that satisfy p1 AND p2 and p3?
-Al
On Oct 6, 7:04 pm, Johannes Koch <k...@w3development.dewrote:
Johannes Koch schrieb:
Altu schrieb:
Does /c/d[/a], for example, mean return all d elements that have a
parent (c with a parent root) only if the root has a child a?
Yes, but the root is either c or a.
I mean the root _element_.
So the XPath expression does not
select anything.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Altu wrote:
Thanks for the reply. Also what is the meaning of multiple consequtive
filters like
a[p1][p2][p2]
Does it mean a elements that satisfy p1 AND p2 and p3?
Exactly. By the way, the proper term is "predicates", not filters.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
In article <47***********************@authen.yellow.readfreen ews.net>,
Johannes Koch <ko**@w3development.dewrote:
>>Does /c/d[/a], for example, mean return all d elements that have a parent (c with a parent root) only if the root has a child a?
>Yes, but the root is either c or a.
The root node has exactly one element child, which is the root element.
You can only have /c/d if the root element is c, and [/a] will only
be true if the root element is a, so it will never succeed.
-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: ahogue at theory dot lcs dot mit dot edu |
last post by:
Hello -
Is there any way to match complex subtree patterns with XPath? The
functions I see all seem to match along a single path from root to leaf.
I would like to match full subtrees.
For...
|
by: Anna |
last post by:
Hi all.
I am using Jaxen to evaluate XPath expressions in Java.
I encountered problems when comparing results returned by jaxen with
results
returned by other XPath implementation - I was using...
|
by: gfrommer |
last post by:
Hello everyone,
I've been reading through a bunch of XPath tutorials and am
confused by a couple items. First, is it possible to have multiple
predicates in my XPath statement. For example, the...
|
by: jacksu |
last post by:
I have a simple program to run xpath with xerces 1_2_7
XPathFactory factory = XPathFactory.newInstance();
XPath xPath = factory.newXPath();
XPathExpression xp = xPath.compile(strXpr);...
|
by: David Thielen |
last post by:
Hi;
I am sure I am missing something here but I cannot figure it out. Below I
have a program and I cannot figure out why the xpath selects that throw an
exception fail. From what I know they...
|
by: Altu |
last post by:
Hi,
Is the same as in XPath?
Also if I have a predicate that starts with "/" or "//", does it
matter where in the XPath expression it is?
For example, are these equal:
/a/c/d
|
by: Weston |
last post by:
Poking around with XPath using SimpleXML, it looks like there are at
least a few reasonably common XPath operators and predicates that
aren't supported. I'd like to check my observations against...
|
by: arunairs |
last post by:
Hi,
Is there a way of validating and XPath? In this case , I am
accepting an XPath from the user and I need to validate the XPath
syntax. Is there a regular expression available that anyone can...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |