Comparing 2 DOM objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick

    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.Lo adXml(strGenReq XML)
    domTestReqXML.L oadXml(strTestR eqXML)

    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
  • Stephany Young

    #2
    Re: Comparing 2 DOM objects

    If domGenReqXML.Ou terXML = domTestReqXML.O uterXML Then ...


    "Nick" <Nick@discussio ns.microsoft.co m> wrote in message
    news:9B1B2B02-CDA0-4035-97BE-FA67BE1EDCFE@mi crosoft.com...[color=blue]
    >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.Lo adXml(strGenReq XML)
    > domTestReqXML.L oadXml(strTestR eqXML)
    >
    > 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[/color]


    Comment

    Working...