tinyxml2go

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 11 Imported by: 0

README

tinyxml2-go

An idiomatic, zero-CGO Go port of the tinyxml2.h C library for XML parsing.

Current Status: v0.1.0

This version provides a minimal, pure-Go parser that correctly processes the XML declaration and identifies the root element of a document.

Features:

  • ✅ Parses XML declaration (<?xml ... ?>)
  • ✅ Identifies the root element tag

Work in Progress:

  • 🔜 v0.2.0: Full DOM tree parsing (children, attributes, text).
  • 🔜 v0.3.0: Concurrent tree traversal helpers.

The full port is tracked in our main project issues.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkParse added in v0.3.0

func BenchmarkParse(b *testing.B)

func BenchmarkTraverseConcurrent

func BenchmarkTraverseConcurrent(b *testing.B)

func TraverseConcurrent added in v0.3.0

func TraverseConcurrent(root *Node) ([]string, error)

TraverseConcurrent walks direct children in parallel.

Types

type Node added in v0.3.0

type Node struct {
	Name       string
	Attributes map[string]string
	Text       string
	Children   []*Node
}

Node represents an XML DOM node.

type XMLDocument

type XMLDocument struct {
	Declaration string
	Root        *Node
}

XMLDocument is the top-level container.

func Parse

func Parse(data []byte) (*XMLDocument, error)

Parse builds a full DOM tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL