CompareXML is a fast, lightweight and feature-rich tool that will solve your XML/HTML comparison or diffing needs. its purpose is to compare two instances of Nokogiri::XML::Node or Nokogiri::XML::NodeSet for equality or equivalency.
MIT License
12
stars
3
forks
source link
Element additions are shown as element changes? #6
[{:node1=>
#(Element:0x3c {
name = "hudson.plugins.buildblocker.BuildBlockerProperty",
attributes = [
#(Attr:0x50 { name = "plugin", value = "build-blocker-plugin@1.7.8" })],
children = [
#(Text "\n" + " "),
#(Element:0x64 {
name = "useBuildBlocker",
children = [ #(Text "false")]
}),
#(Text "\n" + " "),
#(Element:0x78 { name = "blockLevel", children = [ #(Text "GLOBAL")] }),
#(Text "\n" + " "),
#(Element:0x8c {
name = "scanQueueFor",
children = [ #(Text "DISABLED")]
}),
#(Text "\n" + " "),
#(Element:0xa0 { name = "blockingJobs" }),
#(Text "\n" + " ")]
}),
:node2=>
#(Element:0xb4 {
name = "hudson.model.ParametersDefinitionProperty",
children = [
#(Text "\n" + " "),
#(Element:0xc8 {
name = "parameterDefinitions",
children = [
#(Text "\n" + " "),
#(Element:0xdc {
name = "hudson.model.StringParameterDefinition",
children = [
#(Text "\n" + " "),
#(Element:0xf0 {
name = "name",
children = [ #(Text "approval_message")]
}),
#(Text "\n" + " "),
#(Element:0x104 { name = "defaultValue" }),
#(Text "\n" + " ")]
}),
#(Text "\n" + " ")]
}),
#(Text "\n" + " ")]
}),
:diff1=>"hudson.plugins.buildblocker.BuildBlockerProperty",
:diff2=>"hudson.model.ParametersDefinitionProperty"}]
Since hudson.plugins.buildblocker.BuildBlockerProperty and com.sonyericsson.rebuild.RebuildSettings are added to the left XML blob but the XML blobs are otherwise the same, I'd expect node1 to show what it does but node2 to be empty. Instead, node2 seems to be showing what is at the spot in the XML tree where it found what is in node1. That doesn't seem right - it should just show the addition.
Consider this code:
produces
Since
hudson.plugins.buildblocker.BuildBlockerProperty
andcom.sonyericsson.rebuild.RebuildSettings
are added to the left XML blob but the XML blobs are otherwise the same, I'd expectnode1
to show what it does butnode2
to be empty. Instead,node2
seems to be showing what is at the spot in the XML tree where it found what is innode1
. That doesn't seem right - it should just show the addition.