Files
webnet/packages/xml
codingetandClaude f659f230cd
CI / lint (pull_request) Successful in 3m39s
CI / format (pull_request) Successful in 3m24s
CI / install (pull_request) Successful in 9m4s
CI / typetest (pull_request) Successful in 3m5s
CI / typecheck (pull_request) Successful in 3m20s
CI / node-tests (pull_request) Successful in 3m31s
CI / browser-tests (pull_request) Successful in 5m16s
docs: add per-package READMEs and position Tailshare as the flagship app
Give every workspace a README describing what it does, its entry points,
and a short usage example, and link them from the root package table.

Frame Tailshare in the root README as the application the libraries exist
to be composed into, with the other apps as development and testing
surfaces. Its own README records what works today and what the open
issues intend for it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 23:51:59 +00:00
..

@webnet/xml

Minimal XML parsing and serialization, with browser-native and Node.js backends.

The package models XML as a plain XMLElement tree (namespace, local name, attributes, children, text) and provides parse/stringify for that tree. stringify collects namespaces used anywhere in the tree and hoists them to xmlns: declarations on the root element, assigning short prefixes (D for DAV:, nsN otherwise). This is used by @webnet/webdav for WebDAV XML bodies.

Entry points

Entry point Description
@webnet/xml el, text, stringify, and parse; resolves to a browser build using DOMParser or a Node.js build using @xmldom/xmldom, selected via the package's browser/default export conditions

Usage

import { el, text, stringify, parse } from "@webnet/xml"

const doc = el("DAV:", "propfind", el("DAV:", "prop", text("DAV:", "displayname", "")))
const xml = stringify(doc)

const parsed = parse(xml)
parsed.localName // "propfind"

See also

  • @webnet/webdav — uses @webnet/xml to build and parse WebDAV request and response bodies