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

Can I add new nodes to an XPathDocument?


I have an XPathDocument which contains a list of color definitions. If I want to add a new color definition to, or
delete an existing one from, the source xml file how can I force this to be reflected in the XPathDocument?

Do I have to reload the XPathDocument? If so, would I need to dispose of the old XPathDocument and it's associated
XPathNavigator somehow?

Can I even change a node value in the XPathDocument? E.g. if I want to change the color description.
Thanks

Steve
Nov 12 '05 #1
2 3443


steve bull wrote:
I have an XPathDocument which contains a list of color definitions. If I want to add a new color definition to, or
delete an existing one from, the source xml file how can I force this to be reflected in the XPathDocument?

Do I have to reload the XPathDocument? If so, would I need to dispose of the old XPathDocument and it's associated
XPathNavigator somehow?

Can I even change a node value in the XPathDocument? E.g. if I want to change the color description.


No, if you want to change nodes in an XML document you need to use a
System.Xml.XmlDocument and not an XPathDocument.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

Thanks, I will change it to an XmlDocument.

Steve

On Fri, 17 Jun 2005 13:21:00 +0200, Martin Honnen <ma*******@yahoo.de> wrote:


steve bull wrote:
I have an XPathDocument which contains a list of color definitions. If I want to add a new color definition to, or
delete an existing one from, the source xml file how can I force this to be reflected in the XPathDocument?

Do I have to reload the XPathDocument? If so, would I need to dispose of the old XPathDocument and it's associated
XPathNavigator somehow?

Can I even change a node value in the XPathDocument? E.g. if I want to change the color description.


No, if you want to change nodes in an XML document you need to use a
System.Xml.XmlDocument and not an XPathDocument.


Nov 12 '05 #3

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

Similar topics

5
by: xmlguy | last post by:
I believe this should be pretty elementary, but for some reason I cannot seem to think of how to write the an XML file from an incoming XML file. Basically this is what I do: Input: ...
2
by: xmlguy | last post by:
Cant seem to solve this problem I need to be able to re-use XmlReader and XPathDocument for an XSLT Transform. Basically I have defined following interfaces: Class Render (Common and...
1
by: tMan | last post by:
whats the xpath to get all the empty nodes in a document. in the xml below i want to get the nodes <empty> and <t> all other nodes either have a child node or text in them <root> <test> <se>...
1
by: chris yoker via DotNetMonster.com | last post by:
hiya, I add new nodes to an xmlDoc. I want to add "innerText" to every newly-created node. current XML file <code> <rows> <row> <PRODUCT-TYPE>bike</PRODUCT-TYPE>...
6
by: Grant | last post by:
I have this simple xml file which wont ever get beyong 3 nodes deep. I need to get the value of the child node of any node with an id of '63'. So fir instance I would be returned 'False' from the...
5
by: Curious | last post by:
Hi, I have the following XML file. Now I am using the code below to return the number of disticnt ProcessID's in the XML file. The result being returned is the...
2
by: Kim Rasmussen | last post by:
Hello there, Anybody out there who can show me how to read a large xml-file without getting Out of Memory exception? I am currently using xmlTextReader but when the reader gets to an element...
0
by: Joe Pannone | last post by:
I need a way to allow a variable to equal an xml document. When using xpathdocument the parameter is asking for a filename. Since I plan on doing a lot of search in the xml document I would like...
6
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, can someone please let me know how I can read xml elements using object oriented program. I created a class to use the get and set properties however I dont know how I can pass the values from...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
0
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...

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.