An abstract class representing XML with nodes of a labeled tree. This class contains an implementation of a subset of XPath for navigation.
- scala.xml.Comment — XML comment
- scala.xml.Elem — XML element
- scala.xml.EntityRef — XML entity
- scala.xml.PCData — Character data section (CDATA)
- scala.xml.ProcInstr — Processing instruction (PI)
- scala.xml.Text — Stand-alone parsed character data
- Companion:
- object
Value members
Abstract methods
Concrete methods
Convenience method, looks up an unprefixed attribute in attributes of this node.
Same as attributes.getValue(key)
Convenience method, looks up an unprefixed attribute in attributes of this node.
Same as attributes.getValue(key)
- Value parameters:
- key
of queried attribute.
- Returns:
value of
UnprefixedAttribute
with given key in attributes, if it exists, otherwisenull
.
Convenience method, looks up a prefixed attribute in attributes of this node.
Same as attributes.getValue(uri, this, key)
-
Convenience method, looks up a prefixed attribute in attributes of this node.
Same as attributes.getValue(uri, this, key)
-
- Value parameters:
- key
of queried attribute.
- uri
namespace of queried attribute (may not be null).
- Returns:
value of
PrefixedAttribute
with given namespace and given key, otherwise'''null'''
.
Returns attribute meaning all attributes of this node, prefixed and
unprefixed, in no particular order. In class Node
, this
defaults to Null
(the empty attribute list).
Returns attribute meaning all attributes of this node, prefixed and
unprefixed, in no particular order. In class Node
, this
defaults to Null
(the empty attribute list).
- Returns:
all attributes of this node
String representation of this node
String representation of this node
- Value parameters:
- stripComments
if true, strips comment nodes from result
Descendant axis (all descendants of this node, not including node itself) includes all text nodes, element nodes, comments and processing instructions.
Descendant axis (all descendants of this node, not including node itself) includes all text nodes, element nodes, comments and processing instructions.
Descendant axis (all descendants of this node, including this node) includes all text nodes, element nodes, comments and processing instructions.
Descendant axis (all descendants of this node, including this node) includes all text nodes, element nodes, comments and processing instructions.
The logic formerly found in typeTag$, as best I could infer it.
The logic formerly found in typeTag$, as best I could infer it.
Convenience method, same as scope.getURI(pre)
but additionally
checks if scope is '''null'''
.
Convenience method, same as scope.getURI(pre)
but additionally
checks if scope is '''null'''
.
- Value parameters:
- pre
the prefix whose namespace name we would like to obtain
- Returns:
the namespace if
scope != null
and prefix was found, elsenull
used internally. Atom/Molecule = -1 PI = -2 Comment = -3 EntityRef = -5
used internally. Atom/Molecule = -1 PI = -2 Comment = -3 EntityRef = -5
Appends qualified name of this node to StringBuilder
.
Appends qualified name of this node to StringBuilder
.
Children which do not stringify to "" (needed for equality)
Children which do not stringify to "" (needed for equality)
method returning the namespace bindings of this node. by default, this is TopScope, which means there are no namespace bindings except the predefined one for "xml".
method returning the namespace bindings of this node. by default, this is TopScope, which means there are no namespace bindings except the predefined one for "xml".
Returns a text representation of this node. Note that this is not equivalent to the XPath node-test called text(), it is rather an implementation of the XPath function string() Martin to Burak: to do: if you make this method abstract, the compiler will now complain if there's no implementation in a subclass. Is this what we want? Note that this would break doc/DocGenator and doc/ModelToXML, with an error message like:
Returns a text representation of this node. Note that this is not equivalent to the XPath node-test called text(), it is rather an implementation of the XPath function string() Martin to Burak: to do: if you make this method abstract, the compiler will now complain if there's no implementation in a subclass. Is this what we want? Note that this would break doc/DocGenator and doc/ModelToXML, with an error message like:
doc\DocGenerator.scala:1219: error: object creation impossible, since there is a deferred declaration of method text in class Node of type => String which is not implemented in a subclass
new SpecialNode {
^
- Definition Classes
Inherited methods
Projection function, which returns elements of this
sequence based
on the string that
. Use:
Projection function, which returns elements of this
sequence based
on the string that
. Use:
this \ "foo"
to get a list of all children that are labelled with"foo"
;this \ "_"
to get a list of all child elements (wildcard);this \ "@foo"
to get the unprefixed attribute"foo"
ofthis
;this \ "@{uri}foo"
to get the prefixed attribute"pre:foo"
whose prefix"pre"
is resolved to the namespace"uri"
.
For attribute projections, the resulting scala.xml.NodeSeq attribute values are wrapped in a scala.xml.Group.
There is no support for searching a prefixed attribute by its literal prefix.
The document order is preserved.
- Inherited from:
- NodeSeq
Convenience method which returns string text of the named attribute. Use:
Convenience method which returns string text of the named attribute. Use:
that \@ "foo"
to get the string text of attribute"foo"
;
- Inherited from:
- NodeSeq
Projection function, which returns elements of this
sequence and of
all its subsequences, based on the string that
. Use:
Projection function, which returns elements of this
sequence and of
all its subsequences, based on the string that
. Use:
this \\ "foo" to get a list of all elements that are labelled with
"foo", including
this`;this \\ "_"
to get a list of all elements (wildcard), includingthis
;this \\ "@foo"
to get all unprefixed attributes"foo"
;this \\ "@{uri}foo"
to get all prefixed attribute"pre:foo"
whose prefix"pre"
is resolved to the namespace"uri"
.
For attribute projections, the resulting scala.xml.NodeSeq attribute values are wrapped in a scala.xml.Group.
There is no support for searching a prefixed attribute by its literal prefix.
The document order is preserved.
- Inherited from:
- NodeSeq
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
It's be nice to make these final, but there are probably people out there subclassing the XML types, especially when it comes to equals. However WE at least can pretend they are final since clearly individual classes cannot be trusted to maintain a semblance of order.
It's be nice to make these final, but there are probably people out there subclassing the XML types, especially when it comes to equals. However WE at least can pretend they are final since clearly individual classes cannot be trusted to maintain a semblance of order.
- Inherited from:
- SeqOps
- Inherited from:
- SeqOps
- Inherited from:
- SeqOps
- Inherited from:
- SeqOps
- Inherited from:
- SeqOps
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
- Inherited from:
- IterableOnceOps
- Inherited from:
- StrictOptimizedSeqOps
Deprecated and Inherited methods
- Deprecated
[Since version 2.13.0]
Use foldLeft instead of /:- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use foldRight instead of :\\- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use iterableFactory instead- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]
Use `dest ++= coll` instead- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use segmentLength instead of prefixLength- Inherited from:
- SeqOps
- Deprecated
[Since version 2.13.0]
Use coll instead of repr in a collection implementation, use the collection value itself from the outside- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]
Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)- Inherited from:
- SeqOps
- Deprecated
[Since version 2.13.0]
Iterable.seq always returns the iterable itself- Inherited from:
- Iterable
- Deprecated
[Since version 2.13.0]
Use .iterator instead of .toIterator- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use toIterable instead- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]
Use `concat` instead- Inherited from:
- SeqOps
- Deprecated
[Since version 2.13.0]
Use .view.slice(from, until) instead of .view(from, until)- Inherited from:
- IterableOps