NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #16 most downloaded on pub.dev
Full-featured XML for Dart — DOM parsing, SAX streaming, XPath 3 querying, and a fluent builder API.
Last release 11 days ago
27 Sep 2026
Release timing varies
gaps range from 9 days to 1.5 years
Most releases are documented
notes for 40 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
91 releases · first in 2012
Deprecated XmlNode.compareNodePosition in favor of compareDocumentPosition.
XmlNode.compareDocumentPosition returning XmlDocumentPosition bitmask flags (isSame, isDisconnected, isPreceding, isFollowing, isContains, isContainedBy, isImplementationSpecific), matching W3C DOM Level 3 / DOM 4.XmlNode.compareNodePosition in favor of compareDocumentPosition.XmlAttribute.isNamespaceDeclaration to distinguish namespace declarations (xmlns or xmlns:*) from regular attributes.elementAttributes getter on XmlAttributesBase and XmlHasAttributes to iterate over attributes excluding namespace declarations.@*), aligning with XPath 3.1 specification.fn:path (/Q{uri}name[idx], @Q{uri}name, text()[idx]).fn:id, fn:idref, and fn:element-with-id with xml:id and DTD <!ATTLIST ... ID/IDREF> attribute declarations.XPathConfiguration to configure evaluation contexts (custom variables, functions, namespaces, documents, environment variables, base URI, unparsed text loader, and trace callback). Deprecated passing variables and functions directly to xpath and xpathEvaluate.fn:serialize) supporting XML, HTML, XHTML, text, JSON, and adaptive output methods with serialization parameters.fn:matches, fn:replace, fn:tokenize, and fn:analyze-string.fn:parse-ietf-date.XPathErrorCode and W3C error codes.xs:duration, xs:dayTimeDuration, xs:yearMonthDuration, xs:dateTime, xs:date, xs:time, and Gregorian date types) for strict W3C compliance.xs:anyAtomicType, xs:error, and string-derived XML Schema constructors.fn:unparsed-text, fn:unparsed-text-lines, fn:unparsed-text-available, fn:json-doc) via unparsedTextLoader.fn:doc, fn:doc-available) and cross-platform environment variable resolution (fn:environment-variable, fn:available-environment-variables).Map and List structures in lookup expressions (?).fn:avg, fn:sum).fn:ceiling, fn:floor, duration operations) against Infinity and NaN./, //), avoiding redundant sorting and deduplication fallbacks. Yields up to 775x speedup on large documents (e.g., at $N=10,000$, //* is ~775x faster dropping from 3.75s to 4.8ms; /root/item/name is ~609x faster dropping from 840ms to 1.38ms; //item is ~307x faster dropping from 870ms to 2.84ms).DescendantOrSelfAxis + ChildAxis into DescendantAxis for steps with non-positional predicates (e.g., //item[@id=100] is ~5.75x faster).XPathInteger instances (0..128) and unboxed integer comparisons for zero-allocation positional predicate matching with early-exit loop termination.!= general comparisons (#207).@experimental annotation from XPath API.example/xml_xpath.dart).One column per quarter.
…validateNamespaces and withNamespaces. This is a BREAKING CHANGE to existing code using these lower-level APIs, as namespaces are no longer available…
XmlDocument.parse and XmlDocumentFragment.parse are now resolved at parse-time and constant when manipulating the DOM (this aligns with other XML libraries and removes surprising behavior when moving nodes around).namespace arguments and replace them with the more intention revealing namespaceUri and namespacePrefix.validateNamespaces and withNamespaces. This is a BREAKING CHANGE to existing code using these lower-level APIs, as namespaces are no longer available by default.XmlNamespaceException for error reporting of invalid namespaces.XmlName is now immutable and the complexity with different states is gone.XmlNamespace node type and XmlHasNamespaces mixin to support reading in-scope namespaces on nodes.XmlParentException. This aligns with standard DOM behavior and improves usability and performance. XmlDocumentFragment nodes are automatically expanded and their children are moved as well.XmlBuilder:
XmlBuilder as all namespace lookups are now in constant time.namespace(String uri, String? prefix) and namespaces(Map<String, String?> uriToPrefix) accessors that have an unusually awkward API. Replaced with namespaceUri(String? prefix, String? uri) and namespaceUris(Map<String, String> prefixToUri) with a clear prefix-uri order.String? namespace arguments when definition elements and attributes. Replaced with more flexible String namespacePrefix and String namespaceUri.||), range (to), quantified (some/every), loops (for), simple map (!), lookup (?), and node comparison (is, <<, >>).fn:function-lookup.Q{uri}name).attribute(), document-node() and element()).Nothing published for this version
Dart and Flutter 3.9 compatibility.
Dart 3.8 and PetitParser 7.0 requirement.
Add support for most XPath 1.0 functions, including set-operations and ensuring document order for node-sets.
XmlNode.xpathGenerate to create a readable XPath for all nodes.XmlNode.isEqualNode and XmlNode.compareNodePosition.Nothing published for this version
Nothing published for this version
Dart 3.0 and PetitParser 6.0 requirement.
Fix pubspec.yaml for publication
Fix pubspec.yaml for publication
XmlElement.tag constructor that greatly simplifies the creation of elements, i.e. XmlElement(XmlName('br'), [], [], true) becomes XmlElement.tag('br', isSelfClosing: true).XmlNode.text: Replace with XmlNode.value to access the textual contents of the node, or XmlNode.innerText to access the textual contents of its descendants.XmlNode.siblings and various related methods to also work correctly on XmlAttribute nodes, make the method return a mutable list.XmlNode.replace(XmlNode) and add XmlNode.remove() for easy removal of a node.Bump to 6.2.2 for a bugfix release of the bugfix release
Bump to 6.2.2 for a bugfix release of the bugfix release
Nothing published for this version
Upgrade to PetitParser 5.1 brings a 10% speed improvement (typed sequences).
XmlEvent with tapEachEvent (similar to forEachEvent).XmlName equality operator == and hashCode. This is inconsistent with the other DOM nodes, and the provided implementation might not have the desired behavior.innerText or innerXml on DOM nodes that cannot have children.Validate the presence and order of root nodes when parsing; this got lost in 6.0.0 and can now also optionally be enabled for streaming and iterable p
XmlDoctype can now be accessed through name, externalId and internalSubset.Nothing published for this version
Remove deprecated XmlTransformer as it requires dynamic calls in the XmlVisitor.
XmlTransformer as it requires dynamic calls in the XmlVisitor.XmlVisitor.XmlBuilder keeps keeps correct nesting, even in case of exceptions.parse(String input): use XmlDocument.parse(String input) or XmlDocumentFragment.parse(String input) instead.XmlBuilder.build(): use XmlBuilder.buildDocument() or XmlBuilder.buildFragment() instead.XmlNormalizer.defaultInstance: use const XmlNormalizer() instead.XmlProductionDefinition, XmlGrammarDefinition, and XmlParserDefinition.Nothing published for this version
Escape control characters (thanks to rspilker).
qualifiedName, localName, namespacePrefix and namespaceUri for convenience on the named nodes.Nothing published for this version
- Dart 2.15 requirement. - Upgrade to PetitParser 4.3.
A series of read-only accessors that simplify navigating the XML DOM with XmlElements:
XmlElements:
XmlNode.childElements.XmlNode.siblings and XmlNode.siblingElements.XmlNode.previousElementSibling and XmlNode.nextElementSibling.XmlNode.ancestorElements, XmlNode.precedingElements, XmlNode.descendantElements, and XmlNode.followingElements.Nothing published for this version
- Fix printing of Exceptions. - Fix parsing of DOCTYPE tags.
- Upgrade to PetitParser 4.1.0.
Nothing published for this version
Nothing published for this version
Dart 2.12 requirement and null-safety.
XmlBuilder to add raw strings.Nothing published for this version
Nothing published for this version
Fixed a bug in the XML name parsing where certain unicode planes were not correctly recognized.
XmlEvent to be able to add a lazy initialized parentEvent field.XmlWithParentEvents that provides validation of event nesting and efficient access to the parent events. Use stream.withParentEvents() to annotate the stream accordingly.event.namespaceUri. Note that the data is only available when the parent information is present (see above).stream.forEachEvent(onText: ...) for easier callback based stream processing.Nothing published for this version
Add a XmlSubtreeSelector that allows efficient filtering of events in specific sub-trees. Use stream.selectSubtreeEvents(...) to filter the stream acc
XmlSubtreeSelector that allows efficient filtering of events in specific sub-trees. Use stream.selectSubtreeEvents(...) to filter the stream accordingly.Improve error reporting of XmlBuilder and add possibility to build XmlDocumentFragments.
XmlBuilder and add possibility to build XmlDocumentFragments.Deprecate standalone XmlDocument parse(String input) method, and introduce factory methods in the respective nodes XmlDocument.parse(String input) and…
XmlDocument parse(String input) method, and introduce factory methods in the respective nodes XmlDocument.parse(String input) and XmlDocumentFragment.parse(String input).XmlNode.innerText (in most cases an alias to XmlNode.text), XmlNode.innerXml and XmlNode.outerXml.XmlDocumentFragment across the library.XmlDocument.text override, which returned null.XmlNode.replace(XmlNode other) to make it easier to replace nodes in an existing tree.XmlNode.getElement(String name) as a shortcut to find the first child element with a given name.XmlNode.firstElementChild and XmlNode.lastElementChild to easy access the first/last child element.document.toXmlString(pretty: true, preserveWhitespace: (node) => node is XmlElement && node.name.local == 'pre') would keep everything within <pre> tags as-is.Improve the pretty printing and the customization of the pretty printing:
XmlWriter and XmlPrettyWriter are now initialized with optional arguments.setAttribute and removeAttribute.xml_events package.Dart 2.7 compatibility and requirement.
Nothing published for this version
Entity decoding and encoding is now configurable with an XmlEntityMapping. All operations that read or write XML can now (optionally) be configured wi
XmlEntityMapping. All operations that
read or write XML can now (optionally) be configured with an entity mapper.XmlDefaultEntityMapping.html5.XmlParserError a FormatException to follow typical Dart exception style.Dart 2.3 compatibility and requirement.
Nothing published for this version
Dart 2.2 compatibility and requirement.
Nothing published for this version
New events based parsing in xml_events:
xml_events:
Iterable of XmlEvent.XmlEvent and XmlNode.src/ subtree.Nothing published for this version
Remove unnecessary whitespace when printing self-closing tags.
Nothing published for this version
Nothing published for this version
Nothing published for this version
- Migrated to PetitParser 2.0
Nothing published for this version
Dart 2.0 strong mode compatibility
Nothing published for this version
- Fix CDATA encoding - Migrate to micro libraries - Fixed linter issues
Generic Method syntax with Dart 1.21
Preserve single and double quotes
- Improved documentation
- Use enum as the node type
- Fixed attribute escaping
- Fixed linter issues - Cleanup node hierarchy
- Improved documentation
Your coding agent can read these notes before it upgrades. Set up the MCP server →