Expensive method to obtain all comments, throughout the tree
Expensive method to obtain all processing instructions, throughout the tree
Returns the immediate child nodes of the document.
Returns the immediate child nodes of the document. That includes at least the document element, but top-level comments and processing instructions are also returned.
Returns the document element
Returns the document element
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!
Returns withDocumentElement(this.documentElement.transformElemsOrSelf(f))
Returns withDocumentElement(this.documentElement.transformElemsToNodeSeq(f))
Returns updated(path) { e => newElem }
Returns withDocumentElement(this.documentElement.updated(path)(f))
.
Returns withDocumentElement(this.documentElement.updatedAtPaths(paths)(f))
Returns withDocumentElement(this.documentElement.updatedWithNodeSeq(path, newNodes))
Returns withDocumentElement(this.documentElement.updatedWithNodeSeq(path)(f))
Returns the optional document URI, wrapped in an Option
Returns the optional document URI, wrapped in an Option
Creates a copy, but with the new documentElement passed as parameter newRoot
Creates a copy, but with the new uriOption passed as parameter newUriOption
Document
. Although at first sight the document root element seems to be the root node, this is not entirely true. For example, there may be comments at top level, outside the document root element.The document is itself not a
Node
. This choice has the following advantages:toTreeRepr
should not be passed a parent scope. By not considering a Document a Node, it is more visible that parent scopes are irrelevant for Documents, unlike for "elements".A
Document
is constructed from an optional URI, a document element (asElem
), top-level processing instructions, if any, and top-level comments, if any.Note that class
Document
does not have any query methods forElem
instances. In particular, theParentElemApi
does not apply to documents. Therefore, given a document, querying for elements (other than the document element itself) always goes via the document element.