{"id":22291627,"url":"https://github.com/mithunsatheesh/node-xml-compare","last_synced_at":"2025-10-28T13:43:36.632Z","repository":{"id":8383504,"uuid":"9957206","full_name":"mithunsatheesh/node-xml-compare","owner":"mithunsatheesh","description":"xml difference engine on node.js","archived":false,"fork":false,"pushed_at":"2013-05-17T12:25:48.000Z","size":210,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T18:52:19.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mithunsatheesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-09T10:31:37.000Z","updated_at":"2019-09-14T08:32:49.000Z","dependencies_parsed_at":"2022-07-31T00:47:50.685Z","dependency_job_id":null,"html_url":"https://github.com/mithunsatheesh/node-xml-compare","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithunsatheesh%2Fnode-xml-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithunsatheesh%2Fnode-xml-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithunsatheesh%2Fnode-xml-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithunsatheesh%2Fnode-xml-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mithunsatheesh","download_url":"https://codeload.github.com/mithunsatheesh/node-xml-compare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245550588,"owners_count":20633871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T17:17:48.379Z","updated_at":"2025-10-28T13:43:36.566Z","avatar_url":"https://github.com/mithunsatheesh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#[node-xml-compare](http://mithunsatheesh.github.io/node-xml-compare)\n\nxml compare is a node.js package to compare two xml strings. \n\n\n\n##Description\n\n\nxml compare is built on top of [sax-js](https://github.com/isaacs/sax-js/). It converts the input xml strings into json objects with the help of sax. Then It compares the json to calculate the difference between the parsed objects. The output is a json document with two attributes.\n\n1. `-` : html encoded form of first xml string in which the nodes which are not in second xml are highlighted.\n2. `+` : html encoded form of second xml string in which those additional nodes other than those in first are highlighted.\n\n\n##Install\n\nIt can be installed via.\n\n`npm install node-xml-compare`\n\n\n\n##Usage\n\n\n```javascript\nvar xmlcompare = require('node-xml-compare');\n\nxml1 = '\u003c?xml version=\"1.0\"?\u003e';\nxml1 += '\u003ccatalog\u003e';\nxml1 += '\u003cbook id=\"bk101\"\u003e';\nxml1 += '\u003cauthor\u003eGambardella, Matthew\u003c/author\u003e';\nxml1 += '\u003ctitle\u003eXML Developers Guide\u003c/title\u003e';\nxml1 += '\u003cgenre\u003eComputer\u003c/genre\u003e';\nxml1 += '\u003cprice\u003e44.95\u003c/price\u003e';\nxml1 += '\u003cpublish_date\u003e2000-10-01\u003c/publish_date\u003e';\nxml1 += '\u003cdescription\u003eAn in-depth look at creating applications with XML.\u003c/description\u003e';\nxml1 += '\u003c/book\u003e\u003c/catalog\u003e';\n\n\nxml2 = '\u003c?xml version=\"1.0\"?\u003e';\nxml2 += '\u003ccatalog\u003e';\nxml2 += '\u003cbook id=\"bk101\"\u003e';\nxml2 += '\u003cauthor\u003eSome one else\u003c/author\u003e';\nxml2 += '\u003ctitle\u003eXML Developers Guide\u003c/title\u003e';\nxml2 += '\u003cgenre\u003eComputer\u003c/genre\u003e';\nxml2 += '\u003cprice\u003e440.95\u003c/price\u003e';\nxml2 += '\u003cpublish_date\u003e2000-10-01eee\u003c/publish_date\u003e';\nxml2 += '\u003c/book\u003e\u003c/catalog\u003e';\n\nxmlcompare(xml1, xml2, function(result) {\n\n\t\n\t//render result[-] to code blocks in html page to show the xml1 nodes that are not in xml2\n\t//render result[+] to code blocks in html page to show the xml2 nodes that are not in xml1\n\n\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithunsatheesh%2Fnode-xml-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmithunsatheesh%2Fnode-xml-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithunsatheesh%2Fnode-xml-compare/lists"}