-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdoc.go
More file actions
59 lines (59 loc) · 2.44 KB
/
Copy pathdoc.go
File metadata and controls
59 lines (59 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Package helium is a fast, pure-Go XML toolkit covering XML parsing,
// SAX2-style streaming, XPath 3.1, XSLT 3.0, XInclude, XSD, Relax NG, and
// Schematron. This root package provides tree-based XML parsing, a DOM
// interface, SAX2 callbacks, namespace handling, DTD validation, and
// serialization. See the sub-packages listed below for additional features.
//
// # Parsing
//
// Use [NewParser] to create a parser, configure it with fluent builder methods,
// and call a terminal method to parse XML:
//
// doc, err := helium.NewParser().
// SubstituteEntities(true).
// Parse(ctx, xmlBytes)
//
// For file-based input, use [Parser.ParseFile]:
//
// doc, err := helium.NewParser().ParseFile(ctx, "input.xml")
//
// For streaming input, use [Parser.ParseReader] or [Parser.NewPushParser].
//
// # Serialization
//
// Use [NewWriter] to serialize documents or nodes back to XML:
//
// err := helium.NewWriter().Format(true).WriteDoc(os.Stdout, doc)
//
// # DOM
//
// The document tree consists of [Node] values. Concrete types include
// [Document], [Element], [Text], [Comment], [CDATASection],
// [ProcessingInstruction], [Attribute], [DTD], and [Namespace].
// Tree traversal helpers include [Walk], [Children], [Descendants], and
// [ChildElements].
//
// # Related packages
//
// Sub-packages provide additional XML processing:
//
// - [github.com/lestrrat-go/helium/xpath1] — XPath 1.0
// - [github.com/lestrrat-go/helium/xpath3] — XPath 3.1
// - [github.com/lestrrat-go/helium/xslt3] — XSLT 3.0
// - [github.com/lestrrat-go/helium/xsd] — XML Schema validation
// - [github.com/lestrrat-go/helium/relaxng] — RELAX NG validation
// - [github.com/lestrrat-go/helium/schematron] — Schematron validation
// - [github.com/lestrrat-go/helium/c14n] — XML Canonicalization
// - [github.com/lestrrat-go/helium/xinclude] — XInclude processing
// - [github.com/lestrrat-go/helium/catalog] — OASIS XML Catalog
// - [github.com/lestrrat-go/helium/stream] — Streaming XML writer
// - [github.com/lestrrat-go/helium/sax] — SAX2 handler interfaces
// - [github.com/lestrrat-go/helium/shim] — Drop-in encoding/xml replacement
// - [github.com/lestrrat-go/helium/html] — HTML parser
//
// # Examples
//
// Example code for this package lives in the examples/ directory at the
// repository root (files prefixed with helium_). Because examples are in
// a separate test module they do not appear in the generated documentation.
package helium