{"id":16184136,"url":"https://github.com/eidng8/xml-patch","last_synced_at":"2026-02-09T21:02:30.861Z","repository":{"id":42912947,"uuid":"249627977","full_name":"eidng8/xml-patch","owner":"eidng8","description":"RFC 5261 compliant XML patch","archived":false,"fork":false,"pushed_at":"2022-12-12T13:52:26.000Z","size":1121,"stargazers_count":1,"open_issues_count":16,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T06:39:01.017Z","etag":null,"topics":["typescript","xml","xml-patch"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eidng8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-24T06:14:46.000Z","updated_at":"2024-03-26T13:16:30.000Z","dependencies_parsed_at":"2023-01-27T20:16:52.514Z","dependency_job_id":null,"html_url":"https://github.com/eidng8/xml-patch","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/eidng8/xml-patch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidng8%2Fxml-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidng8%2Fxml-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidng8%2Fxml-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidng8%2Fxml-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eidng8","download_url":"https://codeload.github.com/eidng8/xml-patch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidng8%2Fxml-patch/sbom","scorecard":{"id":369786,"data":{"date":"2025-08-11","repo":{"name":"github.com/eidng8/xml-patch","commit":"697ebd33a5737a04a744f59cb1f3dbdd3a0b4dcf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact Release-v0.1.5 not signed: https://api.github.com/repos/eidng8/xml-patch/releases/25836324","Warn: release artifact Release-v0.1.4 not signed: https://api.github.com/repos/eidng8/xml-patch/releases/25814191","Warn: release artifact Release-v0.1.3 not signed: https://api.github.com/repos/eidng8/xml-patch/releases/25813231","Warn: release artifact 0.1.2 not signed: https://api.github.com/repos/eidng8/xml-patch/releases/25668781","Warn: release artifact 0.1.1-2020.04.19-aca9a48 not signed: https://api.github.com/repos/eidng8/xml-patch/releases/25654480","Warn: release artifact Release-v0.1.5 does not have provenance: https://api.github.com/repos/eidng8/xml-patch/releases/25836324","Warn: release artifact Release-v0.1.4 does not have provenance: https://api.github.com/repos/eidng8/xml-patch/releases/25814191","Warn: release artifact Release-v0.1.3 does not have provenance: https://api.github.com/repos/eidng8/xml-patch/releases/25813231","Warn: release artifact 0.1.2 does not have provenance: https://api.github.com/repos/eidng8/xml-patch/releases/25668781","Warn: release artifact 0.1.1-2020.04.19-aca9a48 does not have provenance: https://api.github.com/repos/eidng8/xml-patch/releases/25654480"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"85 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T12:41:58.656Z","repository_id":42912947,"created_at":"2025-08-18T12:41:58.656Z","updated_at":"2025-08-18T12:41:58.656Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271484173,"owners_count":24767760,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["typescript","xml","xml-patch"],"created_at":"2024-10-10T07:09:06.528Z","updated_at":"2026-02-09T21:02:27.649Z","avatar_url":"https://github.com/eidng8.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XML Patch\n\n[![master build](https://img.shields.io/travis/com/eidng8/xml-patch?color=333\u0026logo=travis)](https://travis-ci.com/eidng8/xml-patch) [![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/eidng8/xml-patch?color=333\u0026logo=snyk)](https://snyk.io/test/github/eidng8/xml-patch?targetFile=package.json) [![maintainability](https://img.shields.io/codeclimate/maintainability/eidng8/xml-patch?color=333\u0026logo=code-climate)](https://codeclimate.com/github/eidng8/xml-patch/maintainability) [![master coverage](https://img.shields.io/coveralls/github/eidng8/xml-patch/master?color=333\u0026logo=coveralls)](https://coveralls.io/github/eidng8/xml-patch?branch=master) [![dev build](https://img.shields.io/travis/com/eidng8/xml-patch/dev?color=333\u0026label=dev%20build\u0026logo=travis)](https://travis-ci.com/eidng8/xml-patch/tree/dev) [![dev coverage](https://img.shields.io/coveralls/github/eidng8/xml-patch/dev?color=333\u0026label=dev%20coverage\u0026logo=coveralls)](https://coveralls.io/github/eidng8/xml-patch?branch=dev)\n\nThis library provides functionalities to apply XML patch. It is supposed to be [RFC 5261](https://tools.ietf.org/html/rfc5261) compliant. Documentation can be found in source code, and [online](https://eidng8.github.io/xml-patch/index.html).\n\nCommand line tool can be found [here](https://github.com/eidng8/xml-patch-cli).\n\n## Known issues\n\n1. It is tested with some commonly used XPath queries. However, XPath could be written in complexity beyond the capability of this library. In such circumstances, this library could raise error, or in worse scenarios it may behave unexpected.\n\n2. Due to various reasons, there are a few errors defined in the RFC document, which will not be thrown at all. It doesn't mean those errors won't exist in XML documents, it's just they couldn't be detected by this library, or is interpreted differently and translated into other errors. These errors are:\n\n   - InvalidNamespaceURI (\u003cinvalid-namespace-uri\u003e)\n   - InvalidPrologOperation (\u003cinvalid-prolog-operation\u003e)\n   - UnsupportedIdFunction (\u003cunsupported-id-function\u003e)\n   - UnsupportedXmlId (\u003cunsupported-xml-id\u003e)\n\n3. This package uses webpack. Just in case anyone gets curious, don't fire up `tsc`. It keeps complaining about `xmldom-ts`.\n\n## How to use\n\n```bash\nnpm i -S g8-xml-patch\n```\n\n#### JavaScript\n\n```js\nconst XmlPatch = require('g8-xml-patch');\n\nconsole.log(\n  'This document: \u003ca\u003e\u003cb/\u003e\u003c/a\u003e will be patched to:\\n',\n  new XmlPatch.Patch('\u003cdiff\u003e\u003cadd sel=\"a/b\"\u003e\u003cc/\u003e\u003c/add\u003e\u003c/diff\u003e')\n    .apply('\u003ca\u003e\u003cb/\u003e\u003c/a\u003e')\n    .toString(),\n);\n\ntry {\n  new XmlPatch.Patch().load('\u003cdiff\u003e\u003cb/\u003e\u003c/diff\u003e');\n} catch (ex) {\n  console.log('\\nAnd here comes the expected error:\\n', ex.toString());\n}\n```\n\n#### TypeScript\n\n```ts\nimport { Patch } from 'g8-xml-patch';\n\nconsole.log(\n  'This document: \u003ca\u003e\u003cb/\u003e\u003c/a\u003e will be patched to:\\n',\n  new Patch()\n    .load('\u003cdiff\u003e\u003cadd sel=\"a/b\"\u003e\u003cc/\u003e\u003c/add\u003e\u003c/diff\u003e')\n    .apply('\u003ca\u003e\u003cb/\u003e\u003c/a\u003e')\n    .toString(),\n);\n\ntry {\n  new Patch('\u003cdiff\u003e\u003cb/\u003e\u003c/diff\u003e');\n} catch (ex) {\n  console.log('\\nAnd here comes the expected error:\\n', ex.toString());\n}\n```\n\n## Deviations from RFC 5261\n\nThis library provides a mechanism to suppress exception throwing. One can define a callback function to handle suppressed exceptions.\n\n### Suppressing exceptions\n\n##### `ignoreExceptions(...exceptions:{new():Exception}[] | {new():Exception}[][])`\n\nThe `ignoreExceptions()` global function accepts a list of exceptions to be suppressed. Please note that exceptions that were not listed in the call will **_not_** be suppressed. Once suppressed, the corresponding error will be ignored, and the process of related operation **_may or may not_** go as usual depending on the nature of the error.\n\n- If the error is crucial to the process or the RFC description, related process will be skipped for the occurring target node or action directive.\n- If the error is not crucial, or RFC doesn't provide a clear definition, related process will be performed.\n\n##### `dontIgnoreExceptions()`\n\nThe `dontIgnoreExceptions()` global function simply cancels all suppression from the point of invocation forward.\n\n### Handling suppressed exceptions\n\n##### `setExceptionHandler(handler:ExceptionHandler)`\n\nThe `setExceptionHandler()` global function accepts a callback function, which will be invoked when error occurs and **_were suppressed_**. The callback will be invoked with the exception that would have been thrown if weren't suppressed. However, the return value of the callback function will be ignored. There will be no way for the callback function to affect the flow of process, except throwing an error to break the program.\n\n### Side effects of exception suppression\n\nAs mentioned above, the flow of program may or may not go as usual when errors occur and were suppressed. The behavior introduces a number of side effects, and deviates from the original RFC document.\n\n- When `InvalidNodeTypes` (`\u003cinvalid-node-types\u003e`) is suppressed, it will be possible to replace a target node with multiple nodes.\n- When `UnlocatedNode` (`\u003cunlocated-node\u003e`) is suppressed,\n  - it will be possible to target multiple nodes with the `sel` attribute.\n  - `sel` may yield no match, so the directive will have no effect\n- Combining the above two cases, it will be possible to target multiple nodes, and operate with the same set of nodes provided by a single directive.\n- When `InvalidWhitespaceDirective` (`\u003cinvalid-whitespace-directive\u003e`) is suppressed, directives with `ws` attribute will only remove white space nodes whenever applicable.\n- When `InvalidNodeTypes` (`\u003cinvalid-node-types\u003e`) is suppressed, it will be possible to replace nodes with different types. Say, replacing an element node with text node.\n\nPlease note that the above list is not exhaustive. There may be other side effects haven't been defined or noticed yet.\n\n## Messages translations\n\nAll messages provided in this library can be localized by simply assigning new values to class variables of `Exception`. These messages all start with the `Err` prefix in their names.\n\nThere are samples of translations of two written scripts of Chinese. These samples are provided in TypeScript forms, and their final JavaScript forms.\n\n#### `/translations`\n\nThe two translations here are to demonstrate the final form that will be part of this library's distribution. So in case any of you are interested in contributing to this library, this is the place to submit your translations. To use these translations, simply require it after the main import.\n\n```js\nconst XmlPatch = require('g8-xml-patch');\n\n// must load after xml-patch\nrequire('g8-xml-patch/translations/zh_chs');\n\n// or load your own translation .js file\nrequire('./path/to/your/translation');\n\n// do your stuff.\n```\n\n#### `/src/translations`\n\nThe two translations here are to demonstrate how you can write your own ad-hoc translations in source tree. Please don't use the two files in this directory directly in your code.\n\nTo use these translations, simply:\n\n```ts\nimport { Patch } from 'g8-xml-patch';\n\n// you can use the js version just the same way\nrequire('g8-xml-patch/translations/zh_cht');\n\n// or make and load your own translation .ts file\nimport './path/to/your/translation';\n\n// do your stuff.\n```\n\nHere's a snipped version of source code:\n\n```ts\nimport { Exception } from 'g8-xml-patch';\n\nException.ErrDirective = 'Your take on this';\n\nException.ErrEncoding = 'Just translate it already';\n\n// ... more translation go on ...\n```\n\n## Test data set\n\nThere are some XML files in the `tests/data` directory, which are used for unit testing. They mainly come from two sources:\n\n1. Samples from the [RFC 5261](https://tools.ietf.org/html/rfc5261) document.\n2. Samples from the [diffxml](http://diffxml.sourceforge.net/) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidng8%2Fxml-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feidng8%2Fxml-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidng8%2Fxml-patch/lists"}