![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | XML Dif? Hi, I am a new user to PowerShell. I have written a small program which will send a request in XML and get the response in XML, Now I have to compare the response which I got with Reference response XML. I don't want to comapre line by line but it should be smart enough to give the output saying so & so tag/attribute is missing/added in the actual response xml. Is anybody aware of any such utility? Thanks, Nikhil |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: XML Dif? Do mean you want to compare to an XML schema or to an XML reference file? Have you looked at test-xml in the powershell community extensions http://www.codeplex.com/Wiki/View.as...e=PowerShellCX -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "nikhil" wrote: > Hi, > I am a new user to PowerShell. I have written a small program which > will send a request in XML and get the response in XML, Now I have to > compare the response which I got with Reference response XML. I don't > want to comapre line by line but it should be smart enough to give the > output saying so & so tag/attribute is missing/added in the actual > response xml. Is anybody aware of any such utility? > > Thanks, > Nikhil > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: XML Dif? "RichS" <RichS@discussions.microsoft.com> wrote in message news:44E3F577-A033-4B8A-9C85-8E9244D91F1A@microsoft.com... > Do mean you want to compare to an XML schema or to an XML reference file? > > Have you looked at test-xml in the powershell community extensions > > http://www.codeplex.com/Wiki/View.as...e=PowerShellCX > We don't have Compare-Xml yet but I've been thinking about it. It would be quite useful I think. -- Keith |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: XML Dif? Wouldn't compare-object do this? Example: [xml]$xmldoc1 = $pathtoXml\$xmlfilename [xml]$xmldoc2 = $pathtoXml\$xmlfilename2 compare-object $xmldoc1 $xmldoc2 -- Brandon Shell --------------- Stop by my blog some time ![]() Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject -------------------------------------- "Keith Hill" <r_keith_hill@mailhot.nospamIdotcom> wrote in message news:4F6D2971-8463-4767-A9DC-4D8FD0300B68@microsoft.com... > "RichS" <RichS@discussions.microsoft.com> wrote in message > news:44E3F577-A033-4B8A-9C85-8E9244D91F1A@microsoft.com... >> Do mean you want to compare to an XML schema or to an XML reference file? >> >> Have you looked at test-xml in the powershell community extensions >> >> http://www.codeplex.com/Wiki/View.as...e=PowerShellCX >> > > We don't have Compare-Xml yet but I've been thinking about it. It would > be quite useful I think. > > -- > Keith |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: XML Dif? depending on the situation, it almost feels better to use an XML Schema instead of comparing a generated document to a reference instance document "Brandon Shell" wrote: > Wouldn't compare-object do this? > > Example: > [xml]$xmldoc1 = $pathtoXml\$xmlfilename > [xml]$xmldoc2 = $pathtoXml\$xmlfilename2 > > compare-object $xmldoc1 $xmldoc2 > > -- > Brandon Shell > --------------- > Stop by my blog some time ![]() > Blog: http://www.bsonposh.com/ > PSH Scripts Project: www.codeplex.com/psobject > -------------------------------------- > > "Keith Hill" <r_keith_hill@mailhot.nospamIdotcom> wrote in message > news:4F6D2971-8463-4767-A9DC-4D8FD0300B68@microsoft.com... > > "RichS" <RichS@discussions.microsoft.com> wrote in message > > news:44E3F577-A033-4B8A-9C85-8E9244D91F1A@microsoft.com... > >> Do mean you want to compare to an XML schema or to an XML reference file? > >> > >> Have you looked at test-xml in the powershell community extensions > >> > >> http://www.codeplex.com/Wiki/View.as...e=PowerShellCX > >> > > > > We don't have Compare-Xml yet but I've been thinking about it. It would > > be quite useful I think. > > > > -- > > Keith > > |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: XML Dif? "Brandon Shell" <tshell.mask@gmail.com> wrote in message news:O4ei68GTHHA.5068@TK2MSFTNGP03.phx.gbl... > Wouldn't compare-object do this? > > Example: > [xml]$xmldoc1 = $pathtoXml\$xmlfilename > [xml]$xmldoc2 = $pathtoXml\$xmlfilename2 > > compare-object $xmldoc1 $xmldoc2 That didn't work when I tried it before: 21> $x1 | fxml <doc> <book author="Hugh Jass"> <title>To Here and back</title> </book> </doc> 22> $x2 | fxml <doc> <book author="R. Hugh Jass"> <title>Here, there and everywhere</title> </book> </doc> 23> Compare-Object $x1 $x2 24> Compare doesn't work here unless you specify which properties to compare but that would be too cumbersome (if it would even provide a satisfying result). -- Keith |
My System Specs![]() |