Skip to content

v0.4.9

Choose a tag to compare

@github-actions github-actions released this 12 Nov 22:01
· 7 commits to main since this release
786705b

XML v0.4.9

Diff since v0.4.8

This release adds string_value, pretty = false for write, eachattribute! on a Cursor, and the doctype = :refuse keyword. It also makes wellformed = :strict refuse more documents that XML 1.0 forbids: 679 of the W3C suite's 1257 not-well-formed documents, against 596 with v0.4.8.

New:

  • string_value(node) returns the text of an element, whatever it holds, as XPath 1.0 defines the string-value of a node.
  • write takes pretty = false, which adds and drops no white space between the nodes.
  • eachattribute!(c) reads the attributes of a Cursor's element once, where the cursor stands.
  • doctype = :refuse refuses a document that has a DOCTYPE, before any of its declarations is read.

With these changes, the same call can give another result than with v0.4.8:

  • text() in xpath also selects CDATA sections.
  • :strict refuses a name that breaks the Name rule, such as <doc 12="34"/>.
  • :strict refuses a processing instruction whose target is xml in any case, or that neither white space nor ?> follows.
  • sourcetext, sourcespan and splicetext on a FlatNode keep the line ends of the document, as on a LazyNode.
  • LazyNode and Cursor read the line ends of a declared entity's text as Node and FlatNode do.
  • tag on a FlatNode returns an empty string for a processing instruction without a target, as the other readers do.
  • A DOCTYPE is read when the comment before it begins with >.

Deprecated: for_each_child and @for_each_child, to be removed in v0.5. Call for_each_child! and @for_each_child! instead.

Fixes:

  • Under Julia 1.10, the readers search texts and attribute values through their bytes. next! on a Cursor reaches the end of a document about twice as fast as in v0.4.8.
  • A tag with many attributes is checked for duplicates in O(n log n) time, whatever its names.
  • A chain of declared entities is checked in memory proportional to its length.

The CHANGELOG gives the details of each change.