473,769 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Emulating axis "following-sibling-or-self" without union?

Hi

I'm trying to emulate a "following-sibling-or-self" XPath axis without
using the union operator. The XML looks like this:

<deeply-nested>
<select>
<option value="1">One</option>
<option value="2" selected="selec ted">Two</option>
<option value="3">Three </option>
<option value="4">Four</option>
</select>
</deeply-nested>

I want the option that is selected and subsequent options (i.e., 2, 3
and 4). Is there a convenient way to do this without unioning two
node sets?

Thanks

Niall
Jul 20 '05 #1
1 2610

"Niall Smart" <ni***@pobox.co m> wrote in message
news:ae******** *************** ***@posting.goo gle.com...
Hi

I'm trying to emulate a "following-sibling-or-self" XPath axis without
using the union operator. The XML looks like this:

<deeply-nested>
<select>
<option value="1">One</option>
<option value="2" selected="selec ted">Two</option>
<option value="3">Three </option>
<option value="4">Four</option>
</select>
</deeply-nested>

I want the option that is selected and subsequent options (i.e., 2, 3
and 4). Is there a convenient way to do this without unioning two
node sets?


Use:

/*/*/option[following-sibling::option[1][@selected]] /
following-sibling::option
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #2

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

Similar topics

2
1803
by: Andr? Roberge | last post by:
I want to "import and execute" a python program (input_test.py below) within another program (execute_test.py below) and "watch it" being executed. By watching it, I mean to display the file input_test.py in a window (GUI) and highlighting the line being executed. I am *simulating* this here by printing the line being executed with the corresponding line number and it works as expected for "simple" programs.
5
2112
by: Jeremy | last post by:
I am relatively inexperienced with SQL, and I am trying to learn how to analyze some data with it. I have a table with the following information. COMPANY ID , DATE, MarektValue I would like to select the largest 100 marketvalues for each date in my table. How can I do this efficiently in MySql.
6
5285
by: Matt | last post by:
When I do the following, the mycode will still execute. The reason I put window.opener=top; is to disable the close confirmation dialog box. window.opener = top; window.close(); //mycode... But if I do the following without statement window.opener = top; window.close();
3
2265
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b) 550 queries with a single id in the IN-clause resulting into overall time of <60 seconds; The table consists of 950.000 records, and the resultset consists of 205.000 records.
0
1333
by: Codex Twin | last post by:
hello group: The following is a fragment from a schema which defines the EWethnicCategoryStructure type. As you can see, its type is defined by the SimpleType enumeration EWethnicCategoryType. EWethnicCategoryType is defined as a union with the CommonEthnicCategoryType SimpleType enumeration. Now when I use the XSD tool to create a C# class of this schema, the resulting code does not include the SelectedEthnicCategory enumeration.
9
9599
by: Frederik | last post by:
Hi all, I'm building a C# application that uses a M$ Acces database. In one of the queries I use something like the following: SELECT id FROM mytable WHERE id IN (20, 12, 21, 14) The result is fine, except that the order of the id's is not preserved. It seems to be ordered ascending. How can I keep the order I used as input?
1
2145
by: Sam | last post by:
Hello, I've installed matplotlib recently because I want to add graphing functionality to a GUI that i'm making. I decided to try using the wxAgg backend instead of plain old wx because: a) I hear it's quicker, and b) when i use the wx backend, the axis labels don't seem to work properly - i can't change their font, and the axis label always overwrites my tickbox labels.
0
1951
by: Raheemulla Khan | last post by:
i have created wsdl file by running the following url http://localhost:8080/axis4/services/MyService?wsdl next i run "c:\java org.apache.axis.wsdl.WSDL2Java MyService.wsdl" it is giving following error org.xml.sax.SAXException: Fatal Error: URI=file:///E:/Personal/SMat/My%20Fav/We Services/axis/axis-1_4/samples/userguide/example3/MyService.wsdl Line=2: Conten is not allowed in prolog. at...
0
4264
by: vaibhavsumant | last post by:
<project name="DBCreate" default="usage" basedir="."> <property name="user" value="db2admin"/> <property name="passwd" value="db2admin"/> <property name="dbprefix" value=""/> <property name="driver" value="COM.ibm.db2.jdbc.app.DB2Driver"/> <property name="starturl" value="jdbc:db2:temp"/> <property name="db2dir" location="${basedir}/../../../../.." /> <target name="CreateTestData" > <echo message="in mydbs db2dir = ${db2dir}" />
8
7876
by: aneuryzma | last post by:
Hello, I'm merging an OpenCV app with an Ogre3d app. I'm on a mac, I'm using xCode. When I add #include "openCVApp.h" I got the following error:
0
9422
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
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
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
7404
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
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
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
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.