All notable changes to XML.jl will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New streaming tokenizer (
XMLTokenizermodule) for fine-grained XML token iteration. - XPath support via
xpath(node, path). test/test_libxml2_testcases.jl: 243 test cases borrowed from the libxml2 test suite covering CDATA, comments, processing instructions, attributes, namespaces, DTD internal subsets, entity references, whitespace handling, Unicode, error cases, and real-world document patterns.AbstractTreespackage extension: loading bothXMLandAbstractTreesenablesprint_tree,PreOrderDFS,Leaves, etc. onNodeandLazyNode.
- Tokenizer: multi-byte UTF-8 in attribute values — Parsing attribute values containing multi-byte UTF-8 characters (e.g.,
<doc city="東京"/>) could produce aStringIndexErrorbecauseattr_value()used byte arithmetic (ncodeunits - 1) instead ofprevindto strip quotes. The same issue existed in_read_attr_value!. - Tokenizer: quotes inside DTD comments — A
"or'character inside a<!-- -->comment within a DTD internal subset caused the tokenizer to misinterpret it as a quoted string delimiter, leading to an "Unterminated quoted string" error. The DOCTYPE body parser now correctly skips comment content.
XML.writenow respectsxml:space="preserve"and suppresses indentation for elements with this attribute (#49).
XML.writerespectsxml:space="preserve"on elements, suppressing automatic indentation (#45).
Stringtype ambiguity on Julia nightly resolved (#38).
depthandparentfunctions corrected to work properly with the DOM tree API (#37).escapeupdated to no longer be idempotent — every&is now escaped, matching spec behavior (#32, addressing #31).pushfirst!support added forNodechildren (#29).
- Fixed #26.
- CI updated to use
julia-actions/cache@v4andltsJulia version.
hconstructor for concise element creation (e.g.,h.div("hello"; class="main")).
- Path definition error in README example (#20).
- Minor typos.
- Julia 1.6 compatibility (#16).
- Smarter escaping logic.
- Attribute internal representation changed from
DicttoOrderedDict(later reverted toVector{Pair}).
- Parse method fix.
- DTD parsing via
parse_dtd. is_simpleandsimple_valueexports.setindex!methods for modifying attributes.unescapefunction.
- DOCTYPE parsing made case-insensitive.
- Write output fixes.
- Major rewrite: introduced
NodeTypeenum,Node{S}parametric struct, callableNodeTypeconstructors, andXML.write. - Processing instruction support.
- Benchmarks added.
- Improved print output for
AbstractXMLNode.
- AbstractTrees 0.4 compatibility (#5).
Nodeimplementation withprint_tree.- Color output in REPL display.
- Stopped stripping whitespace from text nodes.
- Initial release.