{"id":58,"date":"2014-11-28T11:13:24","date_gmt":"2014-11-28T18:13:24","guid":{"rendered":"http:\/\/wolfcreekconsulting.com\/blog\/?p=58"},"modified":"2015-01-17T12:34:13","modified_gmt":"2015-01-17T19:34:13","slug":"comparing-xml-generated-from-spfs-export-data-method","status":"publish","type":"post","link":"https:\/\/wolfcreekconsulting.com\/blog\/comparing-xml-generated-from-spfs-export-data-method\/","title":{"rendered":"Comparing XML generated from SPF&#8217;s Export Data method"},"content":{"rendered":"<p>Comparing XML generated by SmartPlant Foundation&#8217;s Export Data command can be a pain, as the XML comes out in what seems to be random order.<\/p>\n<ul>\n<li>Exported objects (XML elements) are in random order<\/li>\n<li>Interfaces in those elements are in random order<\/li>\n<li>Properties (XML attributes) in those interfaces are in random order<\/li>\n<\/ul>\n<p>I have a solution. \ud83d\ude42<\/p>\n<ol>\n<li><a title=\"Download Beyond Compare\" href=\"http:\/\/www.scootersoftware.com\" target=\"_blank\">Download Beyond Compare<\/a> &#8211; the best general-pupose compare tool<\/li>\n<li><a href=\"https:\/\/wolfcreekconsulting.com\/blog\/wp-content\/uploads\/2014\/12\/SPFXMLSortAndTidy_BCSettings.zip\">Download my custom Beyond Compare File Type<\/a>\u00a0for SPF XML comparisons<\/li>\n<\/ol>\n<p>You will have to un-zip this file, then <a href=\"http:\/\/www.scootersoftware.com\/download.php?zz=kb_moreformats\" target=\"_blank\">follow the Beyond Compare instructions<\/a> for importing a <strong>*.bcpkg<\/strong> file. They also have more on their web site.<\/p>\n<p>A Beyond Compare &#8220;File Type&#8221; is sort\u00a0of a filter that modifies the XML on-screen so it can be compared more meaningfully. It does not modify your original files &#8211; unless you make changes in BC and save it.<\/p>\n<p>Once you import this File Type it will default to assuming any *.xml file is an SPF export file, and it will sort and tidy the XML to make it compare more meaningfully.<\/p>\n<ul>\n<li>It sorts all exported objects by the ClassDef (XML element name)<\/li>\n<li>It sorts all the interfaces inside each object by the interface name<\/li>\n<li>It sorts all the attributes inside each interface<\/li>\n<li>If there are multiple objects with the same ClassDef (e.g. multiple &lt;Rel&gt; or &lt;SPXEngineeringDocRevision&gt; elements in your export) then it will sub-sort those based on their UID.<\/li>\n<\/ul>\n<p>So now you can more easily identify what data changes resulted from a method by:<\/p>\n<ol>\n<li>Right-mouse click an object, select\u00a0Export Data, save to a &#8220;before&#8221; file<\/li>\n<li>Make some change to the object<\/li>\n<li>Again right-mouse click the object, select\u00a0Export Data, save to an &#8220;after&#8221; file<\/li>\n<li>Open Beyond Compare to compare the two files<\/li>\n<li>In the File Type dropdown at the top of the Text Compare windows, select &#8220;SPF XML Sorted And Tidied&#8221; (do both sides)<\/li>\n<\/ol>\n<p>Voila! All changes are highlighted in red. \ud83d\ude42<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comparing XML generated by SmartPlant Foundation&#8217;s Export Data command can be a pain, as the XML comes out in what seems to be random order. Exported objects (XML elements) are in random order Interfaces in those elements are in random order Properties (XML attributes) in those interfaces are in random order I have a solution. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-smartplant-foundation-spf"],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":8,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions\/119"}],"wp:attachment":[{"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolfcreekconsulting.com\/blog\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}