By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,566 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,566 IT Pros & Developers. It's quick & easy.

Comparing 2 xml nodes

P: n/a
Hi All,
I am just wondering if there is a way to compare 2 XML nodes to see if
the data between them is the same? The structure of the XML nodes are
exactly the same I just want to know if the data between the two is
different and I want to do this without using XSLT or anything of that
nature, I just want to be able to compare them through code. Something
along the lines of:

XmlNode firstNode;
XmlNode secondNode;

if (firstNode != secondNode) //is the data between the nodes
different?
{
do some stuff here.
}

Thanks in advance!!
Erin
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
How about firstNode.InnerXml == secondNode.InnerXml?

"XmlAdoNewbie" <er************@cowaninsurancegroup.com> wrote in message
news:c9**************************@posting.google.c om...
Hi All,
I am just wondering if there is a way to compare 2 XML nodes to see if
the data between them is the same? The structure of the XML nodes are
exactly the same I just want to know if the data between the two is
different and I want to do this without using XSLT or anything of that
nature, I just want to be able to compare them through code. Something
along the lines of:

XmlNode firstNode;
XmlNode secondNode;

if (firstNode != secondNode) //is the data between the nodes
different?
{
do some stuff here.
}

Thanks in advance!!
Erin

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.