Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.85 KB

XmlValidator.md

File metadata and controls

44 lines (31 loc) · 1.85 KB

XML Validator

It was goal of #520 to add validation support for XML BOM documents based on the CycloneDX XSD specification.

As there is no native XML support in JavaScript, it was researched which solution existed in the both build targets: NodeJS and WebBrowser

NodeJS

Utilizing te existing libxml2 seamed appealing. This lib has all needed capabilities and was already utilized for similar purposes.

To get the libxml2 linked/accessible to NodeJS, native bindings via yp are required.
There are several implementations for this:

  • libxmljs
    • maintained and working -- was abandoned for some time, and appears to be maintaines sporadically, again
  • libxmljs2
  • libxmljs3
    • unmaintained copy of libxmljs2
    • ! DO NOT USE !
  • libxml2-wasm
    • maintained WASM implementation of a libxml2 wrapper

At the moment of writing (2023-04-21), libxmljs and libxmljs2 are both working on several test environments. Both had the needed capabilities.

Decision

2023-04-23

Decided to go with libxmljs2 for the moment, as it was more popular/used and had a more active community.

2024-05-24

Decided to replace libxmljs2, as it is end of life.

WebBrowsers

there seams to exist no solution for validating XML according to XSD