473,326 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

//b[1]//c gives different results if the first b is nested in anotherelement

<a>
<b>
<c/><c/>
</b>
<b>
<c/><c/><c/>
</b>
<b>
<c/>
</b>
</a>

Doing //b[1]//c on that yields two items. If, however, I put the
first <b></bwithin a <d></d>, I get five items. My question is...
why?

Here's what I mean by "put the first <b></bwithin a <d></d>":

<a>
<d>
<b>
<c/><c/>
</b>
</d>
<b>
<c/><c/><c/>
</b>
<b>
<c/>
</b>
</a>

Why does that return 5 items when the first only returns 2?
Sep 14 '08 #1
1 1369
yawnmoth wrote:
<a>
<b>
<c/><c/>
</b>
<b>
<c/><c/><c/>
</b>
<b>
<c/>
</b>
</a>

Doing //b[1]//c on that yields two items. If, however, I put the
first <b></bwithin a <d></d>, I get five items. My question is...
why?

Here's what I mean by "put the first <b></bwithin a <d></d>":

<a>
<d>
<b>
<c/><c/>
</b>
</d>
<b>
<c/><c/><c/>
</b>
<b>
<c/>
</b>
</a>

Why does that return 5 items when the first only returns 2?

//b[1] means select all b that are the first b child of their parent.
If you want to select the first b descendant use
/descendant::b[1]

David
--
http://dpcarlisle.blogspot.com
Sep 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: j askey | last post by:
I have a strange bandwidth issue that I have finally tracked down to something fairly specific if anyone has any ideas... Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI Network: DSL line with...
1
by: Kevin Frey | last post by:
Hello, I have a test database with table A containing 10,000 rows and a table B containing 100,000 rows. Rows in B are "children" of rows in A - each row in A has 10 related rows in B (ie. B has...
10
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it (it's a single SELECT statement). That ran pretty...
1
by: Greg Stark | last post by:
I think this is just a bad case of "nested loops are costed wrong". But it's a really really bad case. Like, even without any overlap in records looked up in the nested loop I cannot imagine it...
6
by: massic80 | last post by:
Hi, it's me again! I have a strange problem with a form I gotta (dynamically) insert in a site, and copied/pasted the code to a blank page, to make it easier to try it out. I was using the $...
4
by: Efi Merdler | last post by:
Hi, I have an xml file with the following structure: <Dictionary> .... <Nested> <Entry> .... </Entry> <Entry> ....
4
by: Pietro Cerutti | last post by:
Hi group, #include <stdio.h> #include <unistd.h> #include <time.h> int main(void) { time_t t1, t2; char *st1, *st2;
11
by: =?Utf-8?B?Um9nZXIgVHJhbmNoZXo=?= | last post by:
Hello, I have a question about the infamous GOTO statement and the way to return a result from a sub: I have a sub that has to make some calls to external COM methods, and because these...
1
by: yawnmoth | last post by:
<?php $content = ' <a> <d> <b> <c/><c/> </b> </d> <b> <c/><c/><c/>
1
isladogs
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...
0
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...
0
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.