The type of the document element.
The type of the document element.
The document type itself.
The document type itself. It must be restricted to a sub-type of the document API trait in question.
Concrete document classes will restrict this type to that document class itself.
Expensive method to obtain all comments, throughout the tree
Expensive method to obtain all processing instructions, throughout the tree
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 withDocumentElement(f(documentElement))
.
Returns withDocumentElement(this.documentElement.updateElemOrSelf(path, newElem))
Returns withDocumentElement(this.documentElement.updateElemOrSelf(path)(f))
.
Returns withDocumentElement(this.documentElement.updateElemWithNodeSeq(path, newNodes))
Returns withDocumentElement(this.documentElement.updateElemWithNodeSeq(path)(f))
Returns withDocumentElement(this.documentElement.updateElemsOrSelf(paths)(f))
Returns withDocumentElement(this.documentElement.updateElemsWithNodeSeq(paths)(f))
Returns withDocumentElement(this.documentElement.updateTopmostElemsOrSelf(f))
Returns withDocumentElement(this.documentElement.updateTopmostElemsWithNodeSeq(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
Creates a copy, but with the new xmlDeclarationOption passed as parameter newXmlDeclarationOption
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, an optional XML declaration, 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, theElemApi
does not apply to documents. Therefore, given a document, querying for elements (other than the document element itself) always goes via the document element.