473,326 Members | 2,102 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.

Select next sibling XPath?

I have some chapters a document goes through, so at the end of each
document I want to output "Continue with XYZ", where XYZ is the
next-sibling of the current one I select. However I don't know how to
write the XPath to express this. I tried variants of this with
ASP/MSXML:

sPhase = "foo"
set xNext = xPhasesDoc.documentElement.selectSingleNode(
"following-sibling::phase[@type = '" & sPhase & "']")

Where the XML is like

----------
<?xml ...?>
<content>
<phase type="foo">Foo</phase>
<phase type="bar">Bar</phase>
</content>
----------

How do I do it?
It's relatively easy to do it another way but I would like to know the
XPath variant...
Jul 20 '05 #1
1 9418

"Philipp Lenssen" <in**@outer-court.com> wrote in message
news:bp*************@ID-203055.news.uni-berlin.de...
I have some chapters a document goes through, so at the end of each
document I want to output "Continue with XYZ", where XYZ is the
next-sibling of the current one I select. However I don't know how to
write the XPath to express this. I tried variants of this with
ASP/MSXML:

sPhase = "foo"
set xNext = xPhasesDoc.documentElement.selectSingleNode(
"following-sibling::phase[@type = '" & sPhase & "']")

Where the XML is like

----------
<?xml ...?>
<content>
<phase type="foo">Foo</phase>
<phase type="bar">Bar</phase>
</content>
----------

How do I do it?

Use:

set xNext =
currentPhaseNode.selectSingleNode("following-sibling::phase[@type = '"

& currentPhaseNode.getAttribute("type")

& "' ][1]")

where currentPhaseNode is the current "phase" node.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #2

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

Similar topics

2
by: Michael K?nig | last post by:
Hello, I've an XML-file structured like this <table> <tr> <td>Nombre:</td> <td>Joseph</td> <td>Apellido:</td> <td>Ratzinger</td>
1
by: Marek Mänd | last post by:
<style> .marek{} </style> etc.. <root> <element class="marek mand"/> <element class="mand marek blah"/> <element class="mand marekmänd"/> <element class="mand marekk"/> </root>
0
by: anthony.raj | last post by:
Hi, I have an XML Datasource in the following format - <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> <table> <event > <field name="user" value="anthony"/> <field name="date"...
11
by: Neo Geshel | last post by:
I have an Access DB, from which I am going to pull images. Each image has an associated ID, but the ID's are not necessarily sequential (some images may have been deleted, leaving gaps in the list...
1
by: paul.rusu | last post by:
XSLT: how to find 2nd next sibling?
11
by: localpricemaps | last post by:
i have some html which looks like this where i want to scrape out the href stuff (the www.cnn.com part) <div class="noFood">Cheese</div> <div class="food">Blue</div> <a class="btn" href =...
4
by: praveen | last post by:
I have a form with treeview control loaded from xml document,text box, two buttons named "Find" and "FindNext" and my treeview which looks like below. Details |__ policy status |__ created by...
2
by: anii | last post by:
Hi I'm a bit new to XML, and I was wondering if anyone could help me with my problem. I have one XML document (readings.xml) being linked to an XSLT document via JavaScript DOM, and am linking the...
10
by: removeps-groups | last post by:
How to display table and select next to each other? <html> <body> <table border=1 style="display:inline-table"> <tr><td>Hello1</td></tr> <tr><td>Hello2</td></tr> <tr><td>Hello3</td></tr>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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...
0
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
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...

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.