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

How to traverse through all the nodes in an XML document

Hello friends,

I have a XML document and I want to modify some of its nodes.
What I need to do is traverse through all the nodes and test the name
of each. If the node is to be modified, I would output the modified
code or I would output the same code.

Is there any way I can get all nodes from the root node? Or, let
me put this question in another way. Is there an easy way to modify
XML document. Say, I want to make minor changes to an XML document
and donot want to touch the rest of the document? How can I do this?

Murtaza.
Jul 20 '05 #1
1 3756
Murtaza Tinwala wrote:
Is there any way I can get all nodes from the root node? Or, let
me put this question in another way. Is there an easy way to modify
XML document. Say, I want to make minor changes to an XML document
and donot want to touch the rest of the document? How can I do this?

Murtaza.


You could do your changes using XSLT and use XPath to get the nodes you
want to edit. An expression like "//*" gets all the nodes in the XML
document. For a quick introduction to XSLT and XPath have a look at
http://www.w3schools.com/ .
Jul 20 '05 #2

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

Similar topics

1
by: Billg_sd | last post by:
I need a routine to search an entire XML document (all nodes) for a specified string & return the count (or return an arraylist of references to the nodes. I've tried various combinations of the...
6
by: Nikhil Patel | last post by:
Hi all, Following is a portion of an XML document. I need to remove all nodes that belong to ns0 without deleting their child nodes. So in the following example , I want to delete "ns0:Proposal"...
2
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
3
by: Stephen | last post by:
I have the following code that uses xquery to return search results from an xml doc. dim xmlString as string xmlString = "siteMapNode/siteMapNode/siteMapNode/siteMapNode"...
1
by: Raed Sawalha | last post by:
I have a TreeView with 4 levels I need to implement Next and Back capability , my problem in how to traverse the tree to achieve this task.
3
by: Shaurya Vardhan | last post by:
Hi, How to Traverse all the nodes of a Tree View Control using VB.Net? Thanx in Advance.
4
by: shinya | last post by:
Hi there! I'm trying to figure out how to traverse an xml hierarchy from within javascript. Here's my text.xml file: <?xml version="1.0" encoding="ISO-8859-1"?> <main> <text1>this is a...
4
by: reflex | last post by:
I have to get every node within range or selection? Is it possible? Sry for my engrish :] Ref
6
by: gskbond | last post by:
Following is my logic to traverse level by level an mway search tree.... (Yeah I finally used templates to implement a queue... :) ) void mWayTree:: TraverseLevelOrder(Node *root,int lvl) {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.