An immutable data object representing an XML element.
Child elements can be other Elems or any one of the other Node types.
XML attributes are implemented with the scala.xml.MetaData base class.
Optional XML namespace scope is represented by scala.xml.NamespaceBinding.
- Value parameters:
- attributes1
the attribute map
- child
the children of this node
- label
the element name
- minimizeEmpty
true
if this element should be serialized as minimized (i.e. "<el/>") when empty;false
if it should be written out in long form.- prefix
namespace prefix (may be null, but not the empty string)
- scope
the scope containing the namespace bindings
- Companion:
- object
Value members
Concrete methods
Returns a new element with updated attributes, resolving namespace uris from this element's scope. See MetaData.update for details.
Returns a new element with updated attributes, resolving namespace uris from this element's scope. See MetaData.update for details.
- Value parameters:
- updates
MetaData with new and updated attributes
- Returns:
a new symbol with updated attributes
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
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'''
.- Inherited from:
- Node
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
.- Inherited from:
- Node
String representation of this node
String representation of this node
- Value parameters:
- stripComments
if true, strips comment nodes from result
- Inherited from:
- Node
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
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.
- Inherited from:
- Node
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.
- Inherited from:
- Node
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
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
- Inherited from:
- Node
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
used internally. Atom/Molecule = -1 PI = -2 Comment = -3 EntityRef = -5
used internally. Atom/Molecule = -1 PI = -2 Comment = -3 EntityRef = -5
- Inherited from:
- Node
- Inherited from:
- SeqOps
- Inherited from:
- SeqOps
Appends qualified name of this node to StringBuilder
.
Appends qualified name of this node to StringBuilder
.
- Inherited from:
- Node
convenience, same as getNamespace(this.prefix)
convenience, same as getNamespace(this.prefix)
- Inherited from:
- Node
- Definition Classes
- ScalaVersionSpecificNodeSeq -> IterableOps
- Inherited from:
- ScalaVersionSpecificNodeSeq
- Inherited from:
- IterableOnceOps
Children which do not stringify to "" (needed for equality)
Children which do not stringify to "" (needed for equality)
- Inherited from:
- Node
- Inherited from:
- StrictOptimizedSeqOps
returns a sequence consisting of only this node
returns a sequence consisting of only this node
- Inherited from:
- Node
Returns a type symbol (e.g. DTD, XSD), default '''null'''
.
Returns a type symbol (e.g. DTD, XSD), default '''null'''
.
- Inherited from:
- Node
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