@kie-tools/xml-parser-ts
v0.32.0
Published
This lets you parse/build XML strings from/to JSON using types and metadata generated with `@kie-tools/xml-parser-ts-codegen`. It uses DOMParser or `jsdom` to parse the XMLs and guarantees that:
Downloads
1,722
Readme
@kie-tools/xml-parser-ts
This lets you parse/build XML strings from/to JSON using types and metadata generated with @kie-tools/xml-parser-ts-codegen
. It uses DOMParser or jsdom
to parse the XMLs and guarantees that:
- Parse/builds are idempotent for XMLs created with
- The JSON resulting from parsing is type-safe, as the metada generated by
@kie-tools/xml-parser-ts-codegen
provides information on what is a string, a boolean, an integer, a float or an array. Even if there's only one element on a sequence,@kie-tools/xml-parser-ts
will make sure it is an array with length 1. - The types generated by
@kie-tools/xml-parser-ts-codegen
can be extended and parsed/built. - Unknown elements/attributes are kept in the original JSON.
- Comments ignored.
Some characteristics:
- Namespaces declared on the original XML can be preserved when building from the JSON.