Returns the tree representation string corresponding to this element, that is, toTreeRepr
.
Returns the tree representation string corresponding to this element, that is, toTreeRepr
.
Possibly expensive, especially for large XML trees! Note that the toString
method is often called implicitly,
for example in logging statements. So, if the toString
method is not used carefully, OutOfMemoryErrors may occur.
Same as toTreeRepr(emptyScope)
Returns the tree representation String, conforming to the tree representation DSL that creates NodeBuilder
s.
Returns the tree representation String, conforming to the tree representation DSL that creates NodeBuilder
s.
That is, it does not correspond to the tree representation DSL of Node
s, but of NodeBuilder
s!
There are a couple of advantages of this method compared to some "toXmlString" method which returns the XML string:
toTreeRepr
clearly corresponds to a NodeBuilder
, and can indeed be parsed into onetoTreeRepr
output is even valid Scala codeNodeBuilder
, the following is out of scope: character escaping (for XML), entity resolving, "ignorable" whitespace handling, etc.
Immutable XML node. The API is inspired by Anti-XML, but it is less ambitious, and differs in some key respects. Like Anti-XML:
Node
for its "owning" document. Yet these nodes can be re-used in several XML trees.Unlike Anti-XML:
QName
s,EName
s andScope
s, the user of the API is somewhat shielded from some XML quirks.Nodes are serializable. Serialized Node instances may well be an interesting storage format for parsed XML stored in a database. Of course, this would be a non-standard format. Moreover, as far as queries are concerned, these columns are mere BLOBs (unless using Java Stored Procedures written in Scala). Besides, serialized NodeBuilders tend to be smaller than serialized Nodes.