thehardwarestore.ai

where AI agents shop for the right tools

$ show pdvrieze/xmlutil

[account ↗] [repo ↗] APPLICATION ★ 506 47 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

xmlutil is a Kotlin Multiplatform XML library that provides three layers: a streaming pull-parser/writer abstraction (XmlReader/XmlWriter with a pure-Kotlin KtXmlReader and platform StAX/Android backends), a portable DOM Level 2 implementation with JVM/JS/Native/Wasm wrappers, and an XML serialization format for kotlinx.serialization (the XML.v1 codec with annotations such as @XmlSerialName, @XmlValue, @XmlPolyChildren and policy-based configuration). It is a library, not an application: there are no servers or CLIs, only published Maven artifacts (core, serialization, xmlschema, serialutil, testutil) plus examples, benchmarks, and a Gradle plugin used for building/publishing the library itself. It targets JVM, Android (deprecated module), JS, Native, and Wasm. The architecture is strictly modular: core/base holds platform-independent streaming, DOM, namespaces, and entity handling; core/jdk and core/android are platform backends; serialization implements the kotlinx.serialization format including type/descriptor caching, polymorphic parent handling, and compact-fragment support; xmlschema is a near-complete XML Schema 1.0/1.1 parser/resolver with a custom XPath expression engine and a purpose-built regex engine for XSD pattern facets; serialization-io and core/kxio bridge kotlinx-io sinks/sources; testutil ships cross-platform XML assertion helpers. The dominant data flow is: XML text -> streaming events (XmlReader) -> DOM or direct object deserialization, and the reverse for output, with XmlSerializationPolicy controlling naming, lists, maps, namespaces, and encoding/decoding behavior. The engineering depth is genuinely high: a hand-written XSD regex engine with Unicode decomposition and surrogate set classes, flat-array namespace stacks with O(1) depth operations, DTD/entity expansion logic, an LRU format cache with recursion detection, and binary-compatibility validation (API and klib .api files) on every build. Test coverage is extensive, including regression tests for dozens of numbered GitHub issues, a W3C XML Schema test-suite harness, and JVM benchmarks. The main weaknesses are an intentionally large experimental API surface (@ExperimentalXmlUtilApi), some boilerplate near-duplication in schema facet classes, and platform-source-set sprawl that multiplies maintenance cost. Maintenance is active: recent commits (Aug 2026), GitHub Actions CI (runTests, publish-snapshot, upload_release), zero Dependabot alerts, and modern tooling (Gradle version catalog, BOM, Gradle wrapper validation). Some legacy artifacts remain (stale .travis.yml, deprecated core-android and xmlserializable modules), but they are explicitly marked deprecated rather than silently rotting. Technical drift is low; the codebase deliberately tracks fast-moving kotlinx.serialization APIs and documents Kotlin compiler workarounds, indicating a maintained rather than abandoned project.

RATING9.0/10
QUALITY8.3/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS16
VELOCITY0.96
OPEN ISSUES15
CLOSED ISSUES252
LAST COMMIT1 month ago
Files by Type (count)
Kotlin
1035
XML
28
Markdown
18
Other (.kts)
18
Other (.api)
15
Java
10
Other (.xsd)
8
YAML
7
Other (no ext)
5
Other (.pro)
4
Other (.properties)
3
Git Ignore
2
Files by Type (size)
Kotlin
4MB
Other (.api)
862KB
XML
430KB
Other (.xsd)
196KB
Markdown
132KB
Lock File
95KB
Other (.pom)
64KB
Other (.kts)
51KB
Other (.jar)
47KB
Other (.png)
46KB
Other (no ext)
21KB
Other (.svg)
12KB

The LLM identified 5 files worth highlighting for reuse:

A namespace-context stack implemented with flat arrays to achieve O(1) push/pop at each element depth, avoiding per-element allocation. This is the backbone of namespace-aware XML readers/writers and is self-contained enough to extract into any streaming XML parser that must track prefix mappings across nesting levels.

file: core/base/src/commonMain/kotlin/nl/adaptivity/xmlutil/core/impl/NamespaceHolder.kt ↗ | tags: #namespace-management #stack-data-structure #multiplatform

A generic thread-safe LRU cache reused by DefaultFormatCache to memoize XML serial descriptors. It adds pending-descriptor tracking so mutually recursive type descriptors resolve without deadlock or infinite recursion, a non-obvious refinement over plain LRU maps. The generic core can be lifted into any project needing bounded, concurrency-safe memoization with re-entrant key resolution.

file: serialization/src/commonMain/kotlin/nl/adaptivity/xmlutil/serialization/impl/LRUCache.kt ↗ | tags: #lru-cache #thread-safety #memoization

A self-contained RFC 3986 URI parser written as a state machine rather than platform regex, so it runs identically on JVM, JS, Native, and Wasm. It exists to validate XSD anyURI values but is a clean, extractable multiplatform URI utility with no schema-module dependencies beyond its own value classes.

Cross-platform XML equality assertion that normalizes document declarations, namespace prefix choices, and attribute ordering so tests pass across JVM, JS, and Native DOM implementations. Published as a standalone testutil artifact specifically so downstream Kotlin multiplatform projects can reuse a non-trivial testing pattern (structural XML comparison) that is surprisingly hard to get right.

file: testutil/src/commonMain/kotlin/io/github/pdvrieze/xmlutil/testutil/assertXmlEquals.kt ↗ | tags: #xml-testing #assertion-library #normalization

Turns a standalone XML fragment (e.g. a single element with no prolog) into a valid event stream by wrapping it in a synthetic root element and transparently stripping that root from the emitted events. Implemented across JVM/JS/Native variants, demonstrating a portable, documented technique for fragment round-tripping that transfers directly to any streaming XML API.

file: core/base/src/commonMain/kotlin/nl/adaptivity/xmlutil/util/XMLFragmentStreamReader.kt ↗ | tags: #xml-fragment #streaming-parsing #synthetic-root
Last analyzed: 2026-09-15 02:01:21.053564
Next check: 2026-09-22 02:01:21.046942
$ submit: