473,386 Members | 2,129 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,386 software developers and data experts.

XmlDocuments selectsinglenode...

Hi all,

[ Scenario ]
I've got a scenario where I revert from a string, into an XmlDocument with
the LoadXml method.
From here I use the SelectSingleNode to get some node within the Xml Dom
returned to me.
I then make alterations to the XmlNode (add and change some attributes...).
Now I fall back into the string realm using the OuterXml property.

[ Question ]
My question is, does this SelectSingleNode provide me with a reference (or
in C++ a pointer) to the XmlDocument, so that changes I make to the XmlNode,
are reflected in the XmlDocument, because the XmlNode is still referencing
the original object?
Or is it the case that calling SelectSingleNode returns me a copy of the
XmlNode at this address, so that changes made are not reflected on the
XmlDocument?
In this way, can I simply call the OutXml on the XmlDocument which I
originally loaded the string into, or should I call the "OuterXml" property
on the "OwnerDocument" of the XmlNode?

Thanks for your time.

Daniel.
Nov 16 '05 #1
2 2341
Daniel,

The xml node is attached to the XmlDocument that it came from. Any
change that you make to the node will be reflected in the document. If you
get the XML of the main document instance after changing the node, it will
be reflected in the xml output.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in
message news:Oj***************@tk2msftngp13.phx.gbl...
Hi all,

[ Scenario ]
I've got a scenario where I revert from a string, into an XmlDocument with
the LoadXml method.
From here I use the SelectSingleNode to get some node within the Xml Dom
returned to me.
I then make alterations to the XmlNode (add and change some attributes...). Now I fall back into the string realm using the OuterXml property.

[ Question ]
My question is, does this SelectSingleNode provide me with a reference (or
in C++ a pointer) to the XmlDocument, so that changes I make to the XmlNode, are reflected in the XmlDocument, because the XmlNode is still referencing
the original object?
Or is it the case that calling SelectSingleNode returns me a copy of the
XmlNode at this address, so that changes made are not reflected on the
XmlDocument?
In this way, can I simply call the OutXml on the XmlDocument which I
originally loaded the string into, or should I call the "OuterXml" property on the "OwnerDocument" of the XmlNode?

Thanks for your time.

Daniel.

Nov 16 '05 #2
Grand, that's what I needed to know.

Thanks! =o)
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u1**************@tk2msftngp13.phx.gbl...
Daniel,

The xml node is attached to the XmlDocument that it came from. Any
change that you make to the node will be reflected in the document. If you get the XML of the main document instance after changing the node, it will
be reflected in the xml output.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in message news:Oj***************@tk2msftngp13.phx.gbl...
Hi all,

[ Scenario ]
I've got a scenario where I revert from a string, into an XmlDocument with the LoadXml method.
From here I use the SelectSingleNode to get some node within the Xml Dom
returned to me.
I then make alterations to the XmlNode (add and change some

attributes...).
Now I fall back into the string realm using the OuterXml property.

[ Question ]
My question is, does this SelectSingleNode provide me with a reference (or in C++ a pointer) to the XmlDocument, so that changes I make to the

XmlNode,
are reflected in the XmlDocument, because the XmlNode is still referencing the original object?
Or is it the case that calling SelectSingleNode returns me a copy of the
XmlNode at this address, so that changes made are not reflected on the
XmlDocument?
In this way, can I simply call the OutXml on the XmlDocument which I
originally loaded the string into, or should I call the "OuterXml"

property
on the "OwnerDocument" of the XmlNode?

Thanks for your time.

Daniel.


Nov 16 '05 #3

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

Similar topics

3
by: John R. | last post by:
I have an application written in C# and i am using MS XML DOM! I have a document with the following structure (only the <DicEntry> - Elements are important): <NewDataSet...
2
by: Edward Yang | last post by:
My XML document has a default namespace specified by xmlns="some_url". Here it is: <?xml version="1.0" encoding="utf-8" ?> <ssmproject name="sample" server="sql"...
7
by: Jason | last post by:
Hi I have an XML file i need to load and read the contents. Here is the top part of the xml file. <Research xsi:schemaLocation="http://www.rixml.org/2002/6/RIXML...
3
by: muscha | last post by:
Hi All, I have this weird problem. I have an xml document and tried to do an XPath query to it. If I use the SelectSingleNode method it throws an exception but it works with SelectNodes method....
7
by: Sashi | last post by:
Two questions: (1) I can pull the text of an XML element as a string just fine using code as such: strSomeString = myXmlDoc.SelectSingleNode("/Element1/Element2/Element3",...
19
by: David Thielen | last post by:
Hi; If there are no namespaces this works fine for me. But if the xml has namespaces, then I get either no node back or an exception. Here is the sample xml: <root xmlns="http://www.test.org"...
1
by: David Lozzi | last post by:
Hello, I'm looking for the best option to combine two XMLDocuments into a single document. I'm using ASP.Net using VB. I have a function that returns a dataset in XML which works great if there...
1
by: Philip Wagenaar | last post by:
I have created to XmlDocument objects. Can they both .Load the same file? Or if the first one loads a file is it locked? I am trying to load an xml file again but the object's value keeps on being...
0
by: compumate99 | last post by:
I am trying to parse the xml document using selectsinglenode method. I am doing this using Visual Foxpro >>> loResultXml = CreateObject("Microsoft.XMLDOM") With loResultXml .Async = .F. ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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?
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
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.