Skip to main content

Crate rusty_xml

Crate rusty_xml 

Source
Expand description

§rusty_xml

crates.io docs.rs CI License: MIT OR Apache-2.0 Remade With Rust By Mata Network

rusty_xml is a ground-up, pure-Rust remake of libxml2: well-formed XML 1.0 parse, arena DOM, SAX2, pull reader, writer/save, XPath 1.0, DTD, C14N, HTML, and working subsets of RelaxNG / XSD / Schematron. #![forbid(unsafe_code)] on every published crate, no C, no libxml2-sys, no copyleft. Defaults are XML_PARSE_NONET | XML_PARSE_NO_XXE — the safe posture libxml2’s own README says the C library does not have.

Part of Remade With Rust by Mata Network — the XML toolkit for the stack that already ships rusty_zstd, rusty_h264, and remade_ffmpeg_rs. Jump to the ecosystem ↓


§The headline

A pure-safe-Rust XML 1.0 toolkit that is a reimplementation, not a wrapper, with libxml2 function names as #[doc(alias)] and safe defaults C historically got wrong:

  • Parse: UTF-8 well-formed documents, 15 built-in 8-bit encodings (no iconv), push (xmlParseChunk), IO callbacks, local OASIS catalogs. SAX traces are gated line-for-line against pinned xmllint --sax.
  • Tree / save / writer / reader: arena DOM, xmlsave (including XML_SAVE_NO_EMPTY / NO_DECL), xmlTextWriter, xmlTextReader. Empty elements are one reader Element, no extra EndElement. parse(write(parse(x))) is a standing gate.
  • XPath 1.0 compile + eval; rxmlint --xpath prints xmllint form.
  • Validate / canonicalize: DTD internal subset + default attributes, xmlValidateDocument, C14N 1.0 and exclusive, XInclude via a caller loader.
  • HTML (HTMLparser.c grammar, implied html/head/body) and working subsets of RelaxNG, XML Schema, and Schematron.
  • CLI is rxmlint, never xmllint. Same flag language so a bench script can swap argv[0].
  • The C oracle is an external process. We never link libxml2. Pin: libxml2 v2.15.3 (oracle/PIN).
libxml2 (C)rusty_xml (Rust)
C/C++ in the dependency treeall of itnone — no libxml2-sys, no iconv, no zlib-sys
unsafe in the published cratesextensive0#![forbid(unsafe_code)]
LicenseMITMIT OR Apache-2.0
Defaults on untrusted inputlibxml2 README: not recommendedNONET | NO_XXE, always
CLI namexmllintrxmlint (does not shadow C)
Network entity loadshistorically onoff unless you pass flags (and the parser still ORs NONET)

§Performance — faster than libxml2

Paired board against pinned libxml2 v2.15.3 xmllint. Pinned to one core (not core 0), High priority, CPU time, arms ABBA-interleaved, N=20 pairs, C-vs-C null arm per row. us/C < 1 means rusty_xml is faster. Raw rows and the full method line: bench/SIDE-BY-SIDE.md.

workload (parse to DOM, discard)rusty_xmllibxml2us/Cwins
big-attr.xml — 627 KB, 48k attributes83.3 MB/s37.2 MB/s0.45×20/20, z = +4.47
big-300k.xml — 308 KB, text-heavy125.6 MB/s78.5 MB/s0.63×20/20, z = +4.47
big-1m.xml — 1.27 MB, real content115.7 MB/s74.6 MB/s0.64×20/20, z = +4.47

1.6× to 2.2× faster than the C library, on every file, in every pair.

Two numbers, because one alone would mislead. The table is as shipped: rxmlint links rusty_alloc (pure-Rust mimalloc) and xmllint uses the system allocator — that is what you actually run. Same allocator, both on the system allocator, the parser alone: big-attr 0.80×, big-300k 1.07×. Roughly half the margin is the allocator, and C could adopt one too. Also: C runs xmlCtxtReadFile per --repeat (the Windows pin has no mmap) while we do one fs::read then xml_read_memory — about 1% at these sizes, but it inflates C on small files, so the large rows are the honest result. Flags differ (C defaults to XML_PARSE_COMPACT \| XML_PARSE_BIG_LINES; we force NONET \| NO_XXE). This is CLI-vs-CLI, not a kernel A/B. Correctness is gated byte-identical against the same pinned oracle throughout.


§Conformance — where we actually stand

Speed is the easy half. Here is the hard half, measured against the W3C XML Conformance Test Suite rather than against our own corpus, with the pinned C build scored on the identical cases:

rusty_xml 0.8.0libxml2 2.15.3
Total (2036 scored cases)99.9%95.9%
valid documents accepted (601)100.0%100.0%
invalid documents rejected (175)100.0%53.7%
well-formedness (not-wf, 1260)99.8%99.8%

2034 of 2036. Every valid document accepted, every invalid one rejected, and one more not-well-formed case caught than libxml2.

The namespace cases are scored the way libxml2’s own runxmlconf.c scores them – a namespace violation is not a well-formedness error, so the document must PARSE and the error must be REPORTED. Reading them any other way marks both implementations wrong. doc.namespace_errors carries the reports, because the default SAX handler discards errors and a tree-parsing caller would never see them.

The two cases left are not closable honestly: one is a duplicate attribute with the same QName, which is a well-formedness error we reject and libxml2 rejects (the namespace scorer counts that as a failure for both), and the other wants a contradiction between a declared encoding and the byte-order mark to be fatal, where C exits zero. libxml2 fails three; we fail two.

A correction. 0.4.0 published “79.9%, level with libxml2” and that number was measured wrong. The suite marks 313 cases EDITION="1 2 3 4" – they test the name rules of XML 1.0 before the 5th edition, which is not the language either implementation parses by default. libxml2’s own runxmlconf.c reads that attribute and parses those cases with XML_PARSE_OLD10; our runner ignored it and scored a 5th-edition parser against 4th-edition expectations, counting 313 non-failures as failures for both sides. Correcting the runner moved the real figures to 90.0% and 94.8% – we were behind, not level – and exposed that XML_PARSE_OLD10 never reached the DTD parser at all.

0.2.0 never ran the suite. The first run, in 0.3.0, crashed before scoring a single case – a 32 GB allocation reachable from thirty-two bytes of DTD – and then scored 59.1%. Everything since came from reading failures rather than guessing: an internal subset parser that was a scanner rather than a parser, four literals never character-validated, a validator whose ID branch said “uniqueness checked loosely” and meant not at all, and an entity whose replacement text was inserted as escaped text instead of the markup it was.

Run it yourself — the suite is fetched, never vendored:

pwsh scripts/fetch-xmlconf.ps1
cargo run --release -p rusty_xml-bench --bin xmlconf -- --oracle

What we do gate hard, and what those numbers cost nothing:

  • 62 of 64 byte-identical comparisons against pinned xmllint over 16 corpora x {plain, --format, --c14n, --exc-c14n}. The two exceptions are one deliberate divergence: we serialize the internal DTD subset verbatim where C re-serializes and reorders it.
  • 0 unsafe in all twelve crates.
  • Nothing on the parse, save, format, XPath, stream or canonicalize path recurses per level of nesting, so document depth cannot exhaust the stack.
  • A seeded fuzzer (--bin fuzz) holds four invariants: no panics, chunked parsing equals whole parsing at every chunk size, and both XML and HTML round trips are fixed points.

If you need full libxml2 conformance today, use libxml2. If you need a memory-safe XML toolkit that is faster than C, has no C in its dependency tree, and tells you exactly which cases it gets wrong, this is it.


§What is this?

rusty_xml is libxml2 remade in Rust. Unlike libxml2-sys / quick-xml / roxmltree — bindings or different grammars — there is no C in the dependency tree here and the public names match C (xmlReadMemoryxml_read_memory, documented with #[doc(alias)]).

libxml2’s own README says it is not recommended for untrusted data. That is the defect this remake exists to close: semantic identity under matched options, safe defaults (no network, no XXE, bounded amplification).

It is a reimplementation of the algorithms, not a fork. The C sources are neither distributed nor linked; a pinned xmllint is used only as an external-process oracle (scripts/fetch-oracle.ps1).

cargo-deny enforces the promise: no *-sys crate, no copyleft, and no libxml2-sys anywhere in the graph.

§The Remade With Rust ecosystem

Remade With Rust is an initiative by Mata Network to rebuild essential C and C++ tools in Rust — for the memory safety, the predictable performance, and the freedom of a permissive license. Each project is a reimplementation, not a fork: same wire protocols and file formats, new code you can actually depend on.

We build the core to production grade and open-source it so the community can extend it. No copyleft. No surprises. Just the tools we rely on, made faster and safer.

ProjectWhat it is
🎬 remade_ffmpeg_rsOur FFmpeg alternative. Drop-in ffmpeg and ffprobe binaries — demux → decode → filter → encode → mux, rebuilt as composable Rust crates with zero GPL/LGPL. Apache-2.0.
🧠 FFAIOur sister project: media for AI. “The AI media toolkit, remade with rust.” Embedded ASR + TTS (Mercury), OCR (Carmenta) and vision-language captioning (Argus) behind an ffmpeg-style, swap-by-name architecture — no Python, no CUDA. MIT OR Apache-2.0.
🌐 Mata NetworkThe home page. “Stop sacrificing your privacy for convenience.” Sovereign, self-hostable privacy infrastructure — wallet & identity, password manager, contact manager, and a browser extension that stops information leaking as you browse. Remade With Rust is its open-source arm.

→ All projects: github.com/Remade-With-Rust

§Install

One crate — rusty_xml — is the public facade; it re-exports parser, tree, SAX, reader, writer, XPath, and validation. Add it with:

cargo add rusty_xml

or in Cargo.toml:

[dependencies]
rusty_xml = "0.8"

MSRV is 1.85. The library never sets #[global_allocator].

The published crates (all 0.1, MIT OR Apache-2.0):

CrateRoleDocs
rusty_xmlthe facade — depend on thisdocs.rs
rusty_xml-parserwell-formed parse, encodings, push, catalogs, HTMLdocs.rs
rusty_xml-treearena DOMdocs.rs
rusty_xml-saxSAX2 recorder + xmllint-debug dumpdocs.rs
rusty_xml-readerxmlTextReaderdocs.rs
rusty_xml-writerxmlsave + xmlTextWriterdocs.rs
rusty_xml-xpathXPath 1.0docs.rs
rusty_xml-validDTD, C14N, RelaxNG, XSD, Schematrondocs.rs
rusty_xml-clirxmlint binary
rusty_xml-allocallocator seam for binaries only — the library never uses it

Not published: rusty_xml-bench (oracle harness), rusty_xml-c-abi (M8 stub).

The library picks no allocator. rusty_xml-alloc pins rusty_alloc for rxmlint; the published library declares no #[global_allocator] and does not depend on it, so an embedding application keeps that choice — and gets the same win for free if it already ships rusty_alloc.

Dropping it into a downstream tool: depend on the facade. Call xml_read_memory / xml_reader_for_memory / xml_xpath_eval. Do not add libxml2-sys. Safe defaults are already on; you do not opt into NONET.

§Quick start

use rusty_xml::{default_parse_options, xml_read_memory, xml_save_doc};

fn main() -> Result<(), rusty_xml::XmlError> {
    let xml = br#"<root><item id="1">hi</item></root>"#;
    let doc = xml_read_memory(xml, None, None, default_parse_options())?;
    let bytes = xml_save_doc(&doc, 0);
    assert!(std::str::from_utf8(&bytes).unwrap().contains("<item"));
    Ok(())
}

XPath 1.0 on the same tree:

use rusty_xml::{
    default_parse_options, xml_read_memory, xml_xpath_eval, XmlXPathContext, XPathObject,
};

fn main() -> Result<(), rusty_xml::XmlError> {
    let doc = xml_read_memory(
        br#"<root><item>a</item><item>b</item></root>"#,
        None,
        None,
        default_parse_options(),
    )?;
    let ctx = XmlXPathContext::xml_xpath_new_context(&doc);
    match xml_xpath_eval("count(//item)", &ctx).unwrap() {
        XPathObject::Number(n) => assert_eq!(n, 2.0),
        other => panic!("expected number, got {other:?}"),
    }
    Ok(())
}

Pull reader:

use rusty_xml::{default_parse_options, xml_reader_for_memory};

fn main() -> Result<(), rusty_xml::XmlError> {
    let mut r = xml_reader_for_memory(
        br#"<a><b/></a>"#,
        None,
        None,
        default_parse_options(),
    )?;
    let mut ticks = 0u32;
    while r.read() == 1 {
        ticks += 1;
    }
    assert!(ticks >= 2);
    Ok(())
}

Command-line (never installs as xmllint):

cargo install rusty_xml-cli
rxmlint --noout file.xml
rxmlint --sax --noout file.xml
rxmlint --stream --noout file.xml
rxmlint --xpath "//item" file.xml
rxmlint --c14n file.xml

§Architecture

The workspace mirrors libxml2’s headers, not its build:

crates/
  rusty_xml           public facade  ← depend on this
  rusty_xml-parser    parser.h — well-formed, encodings, push, catalogs, HTML
  rusty_xml-tree      tree.h — arena DOM
  rusty_xml-sax       SAX2.h — recorder + xmllint-debug dump
  rusty_xml-reader    xmlreader.h
  rusty_xml-writer    xmlsave.h + xmlwriter.h
  rusty_xml-xpath     xpath.h
  rusty_xml-valid     valid.h, c14n, RelaxNG / XSD / Schematron subsets
  rusty_xml-cli       rxmlint (not xmllint)
  rusty_xml-c-abi     optional cdylib, stub until M8. Not published.
  rusty_xml-bench     shells out to pinned xmllint. Never links libxml2.
  rusty_xml-alloc     rusty_alloc seam for binaries only. Library never uses it.
bench/                pinned oracle-vs-us timing harness (pinvs.ps1)
oracle/PIN            libxml2 v2.15.3 pin (binary is gitignored)

§Platform support

PlatformStatus
Windows (x86-64)✅ builds + tests
Linux✅ builds + tests
macOS✅ builds + tests
wasm32-unknown-unknown✅ library cargo check in CI

No C toolchain, no iconv, no nasm. Gzip (XML_PARSE_UNZIP) is not wired yet (a 1f 8b buffer is an error). ISO-2022-JP / Shift_JIS / EUC-JP are unsupported, matching libxml2 built without iconv.

§Roadmap

  • M0 — pin oracle (libxml2 v2.15.3), C-only board, workspace skeleton
  • M1 — character classes, UTF-8 well-formed parse, SAX-exact vs xmllint --sax
  • M2 — tree mutation, xmlsave, xmlTextWriter, xmlTextReader, round-trip
  • M3 — encodings without iconv, push parser, IO callbacks, local catalogs
  • M4 — XPath 1.0 compile + eval, rxmlint --xpath
  • M5 — DTD validation, C14N 1.0 + exclusive, XInclude (loader-gated)
  • M6 — HTML parser, RelaxNG / XSD / Schematron working subsets
  • M7 — performance campaign vs pinned xmllint: faster than C on every corpus file, N=20, 20/20 pairs (bench/SIDE-BY-SIDE.md)
  • Optional gzip (miniz_oxide / XML_PARSE_UNZIP)
  • M8 — W3C conformance suite wired up and scored against the C oracle (65.0% vs libxml2 79.9%); seeded fuzzer; corpus widened 7 -> 16 files
  • M9 — close the conformance gap: 65.0% -> 99.9% on the W3C suite, ahead of libxml2’s 95.9%; 601/601 valid, 175/175 invalid, 1258/1260 not-wf
  • C ABI cdylib (XMLPUBFUN names) + hardening audit
  • Optional gzip (miniz_oxide / XML_PARSE_UNZIP)
  • XML 1.1, external entity loading, CJK multi-byte encodings

Plan: docs/plan/rusty_xml.md.

§License

MIT OR Apache-2.0, at your option — see LICENSE-MIT and LICENSE-APACHE. No GPL/LGPL and no C anywhere in the dependency tree, CI-enforced with cargo-deny. The C xmllint binary used as a measurement oracle is neither distributed here nor linked; see NOTICE.md.

§About Mata Network

Mata Network builds sovereign, self-hostable privacy infrastructure — “stop sacrificing your privacy for convenience”: wallet & identity, a password manager, a contact manager, and a browser extension that stops your information leaking as you browse.

Remade With Rust is our open-source home for the permissively-licensed building blocks that work depends on — including remade_ffmpeg_rs (the FFmpeg alternative) and FFAI (the AI media toolkit).

www.mata.network

Modules§

chvalid
Character classes transcribed from libxml2 v2.15.3 chvalid.h / chvalid.c. xml_is_char uses the xmlIsCharQ formula, not the range tables.

Structs§

AttrDecl
Node
NodeId
Stable handle into an XmlDoc arena. Valid for the lifetime of the doc.
NullSax
A handler that discards every callback, using the trait’s default bodies.
SaxAttr
Attribute as delivered to startElementNs.
SaxRecorder
Records every callback for the event-exact gate.
XmlCatalog
XmlDoc
libxml2 xmlDoc.
XmlDtd
Parsed DTD attached to a document (xmlDtd).
XmlError
Parser / tree error with C discriminant.
XmlParserCtxt
Parser context (xmlParserCtxt).
XmlPushParserCtxt
Push parser context (xmlCreatePushParserCtxt).
XmlTextReader
xmlTextReader.
XmlTextWriter
xmlTextWriter writing into an in-memory buffer.
XmlXPathContext

Enums§

AttrDefault
ElementDecl
NodeKind
libxml2 xmlElementType discriminants.
ReaderType
libxml2 xmlReaderTypes.
SaxEvent
One SAX2 callback as recorded for the event-exact gate.
XPathObject
XmlCharEncoding
libxml2 xmlCharEncoding discriminants.

Constants§

HTML_PARSE_NOIMPLIED
libxml2 htmlParserOption bits we honour.
HTML_PARSE_NONET
XML_C14N_1_0
libxml2 xmlC14NMode.
XML_C14N_1_1
XML_C14N_EXCLUSIVE_1_0
XML_ERR_ATTRIBUTE_NOT_STARTED
XML_ERR_ATTRIBUTE_REDEFINED
XML_ERR_ATTRIBUTE_WITHOUT_VALUE
XML_ERR_CDATA_NOT_FINISHED
XML_ERR_COMMENT_NOT_FINISHED
XML_ERR_DOCUMENT_EMPTY
XML_ERR_DOCUMENT_END
XML_ERR_DOCUMENT_START
XML_ERR_ENCODING_NAME
XML_ERR_ENTITYREF_NO_NAME
XML_ERR_ENTITYREF_SEMICOL_MISSING
XML_ERR_EQUAL_REQUIRED
XML_ERR_EXTRA_CONTENT
XML_ERR_GT_REQUIRED
XML_ERR_HYPHEN_IN_COMMENT
XML_ERR_INTERNAL_ERROR
XML_ERR_INVALID_CHAR
XML_ERR_INVALID_CHARREF
XML_ERR_INVALID_DEC_CHARREF
XML_ERR_INVALID_HEX_CHARREF
XML_ERR_LITERAL_NOT_FINISHED
XML_ERR_LT_IN_ATTRIBUTE
XML_ERR_LT_REQUIRED
XML_ERR_MISPLACED_CDATA_END
XML_ERR_NAME_REQUIRED
XML_ERR_NO_MEMORY
XML_ERR_OK
XML_ERR_PI_NOT_FINISHED
XML_ERR_RESERVED_XML_NAME
XML_ERR_SPACE_REQUIRED
XML_ERR_TAG_NAME_MISMATCH
XML_ERR_TAG_NOT_FINISHED
XML_ERR_UNDECLARED_ENTITY
XML_ERR_UNSUPPORTED_ENCODING
XML_ERR_XMLDECL_NOT_FINISHED
XML_NS_ERR_ATTRIBUTE_REDEFINED
XML_NS_ERR_QNAME
XML_NS_ERR_UNDEFINED_NAMESPACE
XML_NS_ERR_XML_NAMESPACE
XML_PARSE_BIG_LINES
XML_PARSE_CATALOG_PI
XML_PARSE_COMPACT
XML_PARSE_DTDATTR
XML_PARSE_DTDLOAD
XML_PARSE_DTDVALID
XML_PARSE_HUGE
XML_PARSE_IGNORE_ENC
XML_PARSE_NOBASEFIX
XML_PARSE_NOBLANKS
XML_PARSE_NOCDATA
XML_PARSE_NODICT
XML_PARSE_NOENT
XML_PARSE_NOERROR
XML_PARSE_NONET
XML_PARSE_NOWARNING
XML_PARSE_NOXINCNODE
XML_PARSE_NO_SYS_CATALOG
XML_PARSE_NO_TREE
Deliver SAX events without building a document tree. A rusty_xml extension, not a libxml2 flag.
XML_PARSE_NO_XXE
XML_PARSE_NSCLEAN
XML_PARSE_OLD10
XML_PARSE_OLDSAX
XML_PARSE_PEDANTIC
XML_PARSE_RECOVER
libxml2 xmlParserOption bits (numeric identity).
XML_PARSE_SAX1
XML_PARSE_SKIP_IDS
XML_PARSE_UNZIP
XML_PARSE_XINCLUDE
XML_SAVE_AS_HTML
XML_SAVE_AS_XML
XML_SAVE_EMPTY
XML_SAVE_FORMAT
libxml2 xmlSaveOption bits.
XML_SAVE_INDENT
XML_SAVE_NO_DECL
XML_SAVE_NO_EMPTY
XML_SAVE_NO_INDENT
XML_SAVE_NO_XHTML
XML_SAVE_WSNONSIG
XML_SAVE_XHTML
XML_WAR_NS_URI_RELATIVE
XPATH_BOOLEAN
XPATH_NODESET
XPATH_NUMBER
XPATH_STRING
XPATH_UNDEFINED
libxml2 xmlXPathObjectType.

Traits§

SaxHandler
SAX2 handler. Default methods are no-ops so a recorder can override a subset.

Functions§

decode_html_text
Expand character references in HTML text.
default_parse_options
Safe defaults: no network, no XXE.
event_to_xmllint_debug
Format one event the way pinned xmllint --sax prints it.
html_entity
Look up a named character reference. None if it is not an HTML5 name.
html_read_doc
htmlReadDoc.
html_read_file
htmlReadFile.
html_read_memory
htmlReadMemory.
is_pubid_char
PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-’()+,./:=?;!*#@$_%]
merge_dtd
Merge src into dst (external subset onto internal).
parse_dtd_subset
Parse a DTD internal/external subset into declarations.
parse_external_subset
Parse an external subset, where conditional sections are legal and a parameter entity may supply part of a declaration.
xml_c14n_1_0
Inclusive C14N 1.0 without comments.
xml_c14n_doc_dump_memory
xmlC14NDocDumpMemory.
xml_catalog_cleanup
xmlCatalogCleanup — no-op.
xml_char_in_range
Binary search matching xmlCharInRange in chvalid.c.
xml_cleanup_parser
xmlCleanupParser — no-op.
xml_convert_to_utf8
Convert input to UTF-8. hint is the encoding argument to xmlReadMemory.
xml_create_push_parser_ctxt
xmlCreatePushParserCtxt.
xml_ctxt_get_document
xmlCtxtGetDocument.
xml_ctxt_get_last_error
xmlCtxtGetLastError.
xml_ctxt_get_options
xmlCtxtGetOptions.
xml_ctxt_read_memory
xmlCtxtReadMemory.
xml_ctxt_reset
xmlCtxtReset.
xml_ctxt_set_options
xmlCtxtSetOptions.
xml_ctxt_use_options
xmlCtxtUseOptions.
xml_detect_char_encoding
xmlDetectCharEncoding — XML 1.0 appendix F plus libxml2’s UTF-16 extras.
xml_doc_dump_format_memory
xmlDocDumpFormatMemory.
xml_doc_dump_memory
xmlDocDumpMemory.
xml_exc_c14n_1_0
Exclusive C14N 1.0 without comments.
xml_get_char_encoding_name
xmlGetCharEncodingName.
xml_init_parser
xmlInitParser — no process-global ctor in Rust.
xml_initialize_catalog
xmlInitializeCatalog — no-op (no process-global catalog).
xml_is_base_char
xmlIsBaseCharQ.
xml_is_blank
xmlIsBlankQ.
xml_is_char
xmlIsCharQ.
xml_is_combining
xmlIsCombiningQ.
xml_is_digit
xmlIsDigitQ.
xml_is_extender
xmlIsExtenderQ.
xml_is_ideographic
xmlIsIdeographicQ.
xml_is_letter
IS_LETTER.
xml_is_name_char
XML 1.0 5th edition NameChar (default).
xml_is_name_start_char
XML 1.0 5th edition NameStartChar (default). old10 uses Letter | ‘_’ | ‘:’.
xml_is_pubid_char
xmlIsPubidCharQ.
xml_new_parser_ctxt
xmlNewParserCtxt.
xml_new_text_writer_memory
xmlNewTextWriterMemory.
xml_node_dump
xmlNodeDump of a subtree (no XML declaration).
xml_parse_char_encoding
xmlParseCharEncoding.
xml_parse_chunk
xmlParseChunk. terminate != 0 finishes the document.
xml_parse_dtd
xmlParseDTD — parse a DTD from memory (caller already loaded the bytes).
xml_read_doc
xmlReadDoc.
xml_read_file
xmlReadFile.
xml_read_io
xmlReadIO — caller-supplied read callback, no network.
xml_read_memory
xmlReadMemory.
xml_reader_for_doc
xmlReaderForDoc.
xml_reader_for_memory
xmlReaderForMemory.
xml_relaxng_validate_doc
xmlRelaxNGParse + xmlRelaxNGValidateDoc.
xml_save_doc
xmlSaveDoc / xmlDocDumpMemory with xmlSaveOption bits.
xml_sax2_init_default_sax_handler
xmlSAX2InitDefaultSAXHandler is a no-op beyond constructing a recorder.
xml_sax_parse_memory
Parse and record SAX events (for the event-exact gate).
xml_sax_version
xmlSAXVersion — we speak SAX2.
xml_schema_validate_doc
xmlSchemaValidateDoc.
xml_schematron_validate_doc
xmlSchematronValidateDoc.
xml_validate_document
xmlValidateDocument against the document’s attached DTD.
xml_validate_dtd
xmlValidateDtd.
xml_xinclude_process
xmlXIncludeProcess with a caller resource loader.
xml_xpath_cast_to_boolean
xmlXPathCastToBoolean.
xml_xpath_cast_to_number
xmlXPathCastToNumber.
xml_xpath_cast_to_string
xmlXPathCastToString.
xml_xpath_cmp_nodes
xmlXPathCmpNodes.
xml_xpath_compile
xml_xpath_compiled_eval
xmlXPathCompiledEval.
xml_xpath_debug_dump
Dump matching libxml2 xmlXPathDebugDumpObject used by xmllint --xpath / testXPath.
xml_xpath_eval
xmlXPathEval / xmlXPathEvalExpression.
xml_xpath_is_inf
xmlXPathIsInf.
xml_xpath_is_nan
xmlXPathIsNaN.
xml_xpath_order_doc_elems
xmlXPathOrderDocElems — walk document order (preorder).
xml_xpath_print_lint
xmllint --xpath scalar printer (%0g / true / false / string).