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

Comparing 2 DOM objects

I have a scenario, wherein I've loaded 2 XMLDocument objects with 2 different
XML Strings. Apart from traversing down through the DOM, is there any way I
can compare whether the XML's within these DOM objects are identical?

Here's the piece of code that I hvae written as yet:

Dim domTestReqXML As XmlDocument
Dim domGenReqXML As XmlDocument

domTestReqXML = New XmlDocument
domGenReqXML = New XmlDocument

domGenReqXML.LoadXml(strGenReqXML)
domTestReqXML.LoadXml(strTestReqXML)

Here I do not have a .Compare or .Equals option with the DOM. Is there some
other way to do this, save for parsing it?

Cheers!
Nick
Aug 11 '05 #1
1 1331
If domGenReqXML.OuterXML = domTestReqXML.OuterXML Then ...
"Nick" <Ni**@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
I have a scenario, wherein I've loaded 2 XMLDocument objects with 2
different
XML Strings. Apart from traversing down through the DOM, is there any way
I
can compare whether the XML's within these DOM objects are identical?

Here's the piece of code that I hvae written as yet:

Dim domTestReqXML As XmlDocument
Dim domGenReqXML As XmlDocument

domTestReqXML = New XmlDocument
domGenReqXML = New XmlDocument

domGenReqXML.LoadXml(strGenReqXML)
domTestReqXML.LoadXml(strTestReqXML)

Here I do not have a .Compare or .Equals option with the DOM. Is there
some
other way to do this, save for parsing it?

Cheers!
Nick

Aug 11 '05 #2

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

Similar topics

5
by: beliavsky | last post by:
By mistake I coded something like print ("1" > 1) and got the result "True". Comparing an integer and a string seems meaningless to me, and I would prefer to have an exception thrown. Can...
5
by: Skip Montanaro | last post by:
I'd like to compare two xml.dom.minidom objects, but the naive attempt fails: >>> import xml.dom.minidom >>> d1 = xml.dom.minidom.parse("ES.xml") >>> d2 = xml.dom.minidom.parse("ES.xml") >>> d1...
2
by: Raphael Iloh | last post by:
Hi all, I'm having problems comparing array objects. Take a look at this: int array1 = new int{1}; int array2 = new int{1}; Console.Writeln(array1.Equals(array2)); One would expect the above...
5
by: George | last post by:
How do I compare the values of two objects when Option Strict is On? One of the objects is the Tag property from some control (declared as object but holding a value, e.g. an Integer or a String...
19
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor =...
3
by: Mark Denardo | last post by:
Hi I have an app that has a number of textboxes (richtextboxes to be exact) that get created dynamically and I add a few at a time to panel controls (so I can flip a group in and out when I want). ...
5
by: ma740988 | last post by:
There's a need for me to move around at specified offsets within memory. As as a result - long story short - unsigned char* is the type of choice. At issue: Consider the case ( test code ) where...
20
by: Bill Pursell | last post by:
This question involves code relying on mmap, and thus is not maximally portable. Undoubtedly, many will complain that my question is not topical... I have two pointers, the first of which is...
25
by: J Caesar | last post by:
In C you can compare two pointers, p<q, as long as they come from the same array or the same malloc()ated block. Otherwise you can't. What I'd like to do is write a function int comparable(void...
1
by: Kevin Blount | last post by:
I'm getting data from an XML file using this method: $name = $xml->user_info->user; $nickname = $xml->user_info->user; & $age = $xml->user_info->user; $shoe_size = $xml->user_info->user;
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...
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
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.