473,659 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.docu mentElement.sel ectSingleNode(
"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 9430

"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.docu mentElement.sel ectSingleNode(
"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 =
currentPhaseNod e.selectSingleN ode("following-sibling::phase[@type = '"

& currentPhaseNod e.getAttribute( "type")

& "' ][1]")

where currentPhaseNod e 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
5885
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
1665
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
1253
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" value="2005-08-5"/> </event>
11
1941
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 of ID's). I am looking to be able to call an ID and its Image from the database, but also have returned the previous ID and the next ID, even when those actual ID's are not necessarily +1 and -1 to the ID being called. For example, I want to...
1
2880
by: paul.rusu | last post by:
XSLT: how to find 2nd next sibling?
11
2139
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 = "http://www.cnn.com"> so i wrote this code which scrapes it perfectly:
4
6920
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 |__ cover type
2
3618
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 another (customer.xml) through the select="document('customers.xml')/customers/..." /> method in the XSLT document. I have this XML document (customer.xml): <customers> <customer number="__"> <meterNumber> <title>
10
4607
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> <tr><td>Hello4</td></tr> <tr><td>Hello5</td></tr>
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.