Note that there are some explanatory texts on larger screens.

plurals
  1. PONode Comparison and replacement in Java
    primarykey
    data
    text
    <p>I want to compare 2 XML files "parent.xml", "child.xml", then check whether if a node exists in "parent.xml" and doesn't exists in "child.xml" then add these nodes to "child.xml" and it should maintain the node hierarchy. </p> <p><strong>Structure of "Parent.xml"</strong></p> <pre><code>&lt;chart&gt; &lt;chartconf alignTicks="true" animation="true" backgroundColor="#FFFFFF" borderColor="#4572A7" borderRadius="5" borderWidth="0" className="" defaultSeriesType=""&gt; &lt;/chartconf&gt; &lt;legend&gt; &lt;align&gt;center&lt;/align&gt; &lt;backgroundColor&gt;null&lt;/backgroundColor&gt; &lt;borderColor&gt;#909090&lt;/borderColor&gt; &lt;borderRadius&gt;25&lt;/borderRadius&gt; &lt;/legend&gt; &lt;credits&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;position&gt;&lt;/position&gt; &lt;href&gt;http://www.saama.com&lt;/href&gt; &lt;style bek="5555s"&gt;Sixth&lt;/style&gt; &lt;text&gt;Highcharts.com&lt;/text&gt; &lt;/credits&gt; &lt;license&gt; &lt;info&gt; &lt;url&gt;http://eee.example.com&lt;/url&gt; &lt;author&gt;Jhon Doe&lt;/author&gt; &lt;email&gt;xyz@example.com&lt;/email&gt; &lt;type&gt;GNU, MIT dual&lt;/type&gt; &lt;/info&gt; &lt;/license&gt; </code></pre> <p></p> <p><strong>Structure of "child.xml"</strong></p> <pre><code>&lt;chart renderTo="pieContainer" &gt; &lt;title align="center" text="Test Title" style="" verticalAlign=""&gt;&lt;/title&gt; &lt;credits enabled="false" position="" href="" style="" text=""&gt;&lt;/credits&gt; &lt;tooltip&gt; &lt;formatter&gt;[function]function() {return this.point.name + " - " + this.percentage;}[/function]&lt;/formatter&gt; &lt;/tooltip&gt; &lt;exporting enabled="true"&gt;&lt;/exporting&gt; &lt;plotOptions&gt; &lt;pie allowPointSelect="true" cursor="pointer"&gt; &lt;dataLabels align="left" enabled="true"&gt;&lt;/dataLabels&gt; &lt;series cursor="pointer" allowPointSelect="true"&gt; &lt;events&gt; &lt;click&gt;[function]function(event) {getAjaxData("ajax/pieDrill.json", this, event)}[/function]&lt;/click&gt; &lt;/events&gt; &lt;/series&gt; &lt;/pie&gt; &lt;/plotOptions&gt; &lt;license&gt; &lt;info&gt; &lt;url&gt;http://eee.example.com&lt;/url&gt; &lt;author&gt;Jhon Doe&lt;/url&gt; &lt;/info&gt; &lt;/license&gt;&lt;/chart&gt; </code></pre> <p>Here in "parent.xml" we can see node <strong>legend</strong> exists but not in child so this should be added in "child.xml"</p> <p>Second node <strong>license</strong> exists in both the xml files but in "child.xml" few nodes are missing so we can add those missing nodes, and it should maintain the same hierarchy.</p> <p>There can be n-levels of nesting and format of XML file is not fixed it can change any time</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload