473,322 Members | 1,755 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,322 software developers and data experts.

Child Nodes Selection

Hi all,

Is it possible to 'cherry-pick' child nodes but retain their
parentage. Given an example...

<user>
<first_name>George</first_name>
<sur_name>George</sur_name>
<dob>George</dob>
<title>Line Manager</title>
</user>

I would like to obtain a node-set that gives me...
<user>
<first_name>George</first_name>
<sur_name>George</sur_name>
</user>

I am trying to achieve this is a single XPATH expression, creating a
variable to hold my new smaller node-set. I am trying to make my
stylesheets less memory intensive by only focusing on those elements I
am interested. Effectively working with smaller records.

Any assistance is very appreciated,

Bryan Galvin
Jul 20 '05 #1
2 1403
In article <97**************************@posting.google.com >,
Bryan Galvin <br**********@hotmail.com> wrote:
Is it possible to 'cherry-pick' child nodes but retain their
parentage.
No.
I am trying to achieve this is a single XPATH expression


XPath is a way of identifying (by "paths") nodes in a document. It
can never return a node that is not in the input. You need to create
a new element with the children you want, or modify an existing node,
and XPath cannot do either of these things.

-- Richard
Jul 20 '05 #2
Richard,

As I suspected. From all my experience of XPATH and XSLT I could not
see how it was feasable. I have embarked on an alternative path where
the nodes I require are prepared several stages before hand into a
<compound_key> element.

Regards,

Bryan Galvin
ri*****@cogsci.ed.ac.uk (Richard Tobin) wrote in message news:<ck***********@pc-news.cogsci.ed.ac.uk>...
In article <97**************************@posting.google.com >,
Bryan Galvin <br**********@hotmail.com> wrote:
Is it possible to 'cherry-pick' child nodes but retain their
parentage.


No.
I am trying to achieve this is a single XPATH expression


XPath is a way of identifying (by "paths") nodes in a document. It
can never return a node that is not in the input. You need to create
a new element with the children you want, or modify an existing node,
and XPath cannot do either of these things.

-- Richard

Jul 20 '05 #3

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

Similar topics

9
by: Rolf Kemper | last post by:
Dear Experts, I got stuck with the following problem and need your help. What I wnat to do is to get a set of distinct nodes. Before the distinct I have selected the multiple occourences...
13
by: kaeli | last post by:
Can anyone explain this to me? It's driving me insane. Save this and run it in IE or Opera and then in Mozilla or Netscape 6+. In IE/Opera, I get the expected 4 alerts. In Mozilla/Netscape, I...
1
by: Hazz | last post by:
I have 5 tables in SQL Server. Each with the following design and a sample chain of the relationships from the root (WRL - World) UUS is the 'Code' of the first table and it is the 'Parent' value...
12
by: Dino L. | last post by:
I am putting data from DataTable to treeView foreach( DataRow aRow in aTable.Rows) { TreeNode tnode = new TreeNode(aRow.ToString() + aRow.ToString() + " " + aRow.ToString());...
7
by: amruta | last post by:
the code below dows not let me get the parent child view... all the nodes are show in one line only... also i need them to be collasped ... Thanks ..
2
by: Jack | last post by:
Hello, I am trying use a TreeView with checkboxes. I would like to check more than one node and allow all child nodes of selected nodes to be checked or unchecked with the parent is checked. ...
1
by: Daniel Rucareanu | last post by:
Hello, Does anybody knows how can you delete, in just one step, not using a loop, a subset of the child nodes of a given DOM parent node? The subset will be continous, so for example, if the...
4
by: reflex | last post by:
I have to get every node within range or selection? Is it possible? Sry for my engrish :] Ref
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
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...
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
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
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.