The helium toolkit provides a suite of auxiliary packages that augment the core XML parser and DOM with essential, standards-compliant XML technologies. These packages cover document composition (XInclude/XPointer), normalization (Canonical XML), resource resolution (OASIS XML Catalogs), HTML parsing, Go standard library compatibility (encoding/xml shim), and XML security (digital signatures and encryption).
This page offers a high-level overview of these supporting technologies and their relationship to the main helium core. For detailed design and API specifics, please refer to the respective child pages.
The xinclude package implements the XML Inclusions (XInclude) 1.1 specification. It enables modular XML document assembly by replacing xi:include elements with external XML content or specific document fragments. This process is critical for reusable and maintainable XML documents.
xinclude.Process() function traverses a document, resolves includes recursively, and merges external resources xinclude/xinclude.go35-40xml:base attributes to preserve correct relative URI resolution in included content xinclude/xinclude.go142-145xinclude package relies on the xpointer package to evaluate xpointer expressions, which select fragments from documents. The xpointer package depends on the xpath1 engine for expression evaluation xpointer/xpointer.go22-28 xinclude/xinclude.go20-40For in-depth details, see XInclude and XPointer.
Sources: xinclude/xinclude.go20-40 xinclude/xinclude.go35-40 xinclude/xinclude.go110-115 xinclude/xinclude.go142-145 xpointer/xpointer.go22-28
The c14n package implements W3C Canonical XML, essential for reliable document digital signatures and equivalence checks by normalizing XML representation.
C14N10), exclusive canonical XML 1.0 (ExclusiveC14N10), and canonical XML 1.1 (C14N11) c14n/c14n.go15-22NewCanonicalizer(Mode) allowing configuration of comment inclusion, node sets, and inclusive namespace prefixes c14n/c14n.go45-50For implementation details, see Canonical XML (C14N).
Sources: c14n/c14n.go15-22 c14n/c14n.go45-50 c14n/nsstack.go10-15 c14n/sort.go10-25
The catalog package handles OASIS XML Catalogs, used to efficiently resolve external identifiers (public IDs, system IDs, URIs) to local or alternate resources, reducing network dependency and improving parsing reliability.
CatalogResolver interface with methods Resolve() (for public/system IDs) and ResolveURI() (for URIs), seamlessly integrated with the helium.Parser catalog/catalog.go25-30 helium/resolver.go10-15For further reading, see OASIS XML Catalog.
Sources: catalog/catalog.go25-30 catalog/catalog.go55-60 helium/resolver.go10-15
The html package offers a specialized parser compliant with HTML 4.01, parsing HTML markup into the standard helium DOM structure. This enables XPath, validation, and transformation tooling to operate on HTML content directly.
*Document where the root node is tagged as HTMLDocumentNode for specialized handling html/parser.go20-25sax package during parsing, facilitating streaming and incremental processing html/parser.go45-50More information is available on the HTML Parser child page.
Sources: html/parser.go20-25 html/parser.go45-50 html/parser.go80-85
The shim package provides a drop-in replacement for Go's standard encoding/xml package APIs, built on top of the helium parsing and writing infrastructure.
Marshal, Unmarshal, NewEncoder, and NewDecoder with identical function signatures, enabling easy substitution shim/shim.go15-30Strict=false) or HTML auto-closing tags.helium errors into standard Go XML errors shim/compat_errors.go5-10For a detailed discussion, see encoding/xml Shim.
Sources: shim/shim.go15-30 shim/decode.go40-45 shim/compat_errors.go5-10
The xmldsig1 package is an experimental implementation of the W3C XML Digital Signatures 1.1 specification enabling signing and verifying XML documents for authenticity and integrity.
NewSigner() and NewVerifier() builders to configure signatures declaratively xmldsig1/signer.go20-25ReferenceConfig and KeyInfoBuilder to customize digest and key information inclusion.c14n package extensively for SignedInfo canonicalization xmldsig1/algorithms.go10-15See XML Digital Signatures (xmldsig1) for implementation specifics.
Sources: xmldsig1/signer.go20-25 xmldsig1/algorithms.go10-15
The xmlenc1 package is an experimental implementation of W3C XML Encryption 1.1, providing robust APIs for encrypting and decrypting XML data.
EncryptElement, EncryptContent, and Decrypt capabilities.EncryptedData and EncryptedKey according to spec xmlenc1/types.go10-15Details can be found in XML Encryption (xmlenc1).
Sources: xmlenc1/encrypt.go30-35 xmlenc1/algorithms.go15-20 xmlenc1/types.go10-15
This diagram illustrates how supporting XML technologies relate to the core helium package, grouped by conceptual layers such as Security, Composition, Processing, and Core.
Sources: .claude/docs/dependencies.md5-52
This diagram maps important code entities (functions, interfaces) to their corresponding XML technology domains, bridging natural language descriptions and codebase structure.
Sources: .claude/docs/packages.md36-42 .claude/docs/packages.md45-50 .claude/docs/packages.md25-30 .claude/docs/packages.md15-30 .claude/docs/packages.md20-25 .claude/docs/packages.md30-35
For detailed technical information, examples, and API references, please consult the corresponding child pages:
Sources:
.claude/docs/dependencies.md5-52 .claude/docs/packages.md32-150 helium/resolver.go10-20
xinclude/xinclude.go20-145 xpointer/xpointer.go22-28 c14n/c14n.go15-50 c14n/nsstack.go10-15
catalog/catalog.go25-60 html/parser.go20-85 shim/shim.go15-30 shim/decode.go40-45 shim/compat_errors.go5-10
xmldsig1/signer.go20-25 xmldsig1/algorithms.go10-15 xmlenc1/encrypt.go30-35 xmlenc1/algorithms.go15-20 xmlenc1/types.go10-15
Refresh this wiki
This wiki was recently refreshed. Please wait 1 day to refresh again.