scala.xml

class NodeSeq

[source: scala/xml/NodeSeq.scala]

abstract class NodeSeq
extends Seq[Node] with SeqLike[Node, NodeSeq]
This class implements a wrapper around Seq[Node] that adds XPath and comprehension methods.
Author
Burak Emir
Version
1.0
Direct Known Subclasses:
Document, Node

Method Summary
def \ (that : java.lang.String) : NodeSeq
Projection function. Similar to XPath, use this \ "foo" to get a list of all elements of this sequence that are labelled with "foo". Use \ "_" as a wildcard. Use ns \ "@foo" to get the unprefixed attribute "foo". Use ns \ "@{uri}foo" to get the prefixed attribute "pre:foo" whose prefix "pre" is resolved to the namespace "uri". For attribute projections, the resulting NodeSeq attribute values are wrapped in a Group. There is no support for searching a prefixed attribute by its literal prefix. The document order is preserved.
def \\ (that : java.lang.String) : NodeSeq
projection function. Similar to XPath, use this \\ 'foo to get a list of all elements of this sequence that are labelled with "foo". Use \\ "_" as a wildcard. Use ns \\ "@foo" to get the unprefixed attribute "foo". Use ns \\ "@{uri}foo" to get each prefixed attribute "pre:foo" whose prefix "pre" is resolved to the namespace "uri". For attribute projections, the resulting NodeSeq attribute values are wrapped in a Group. There is no support for searching a prefixed attribute by its literal prefix. The document order is preserved.
def apply (f : (Node) => Boolean) : NodeSeq
def apply (i : Int) : Node
Returns the elements at position `idx`
override def equals (x : Any) : Boolean
structural equality (XXX - this shatters any hope of hashCode equality)
override def iterator : Iterator[Node]
Creates a new iterator over all elements contained in this iterable object.
def length : Int
Returns the length of the sequence.
protected[this] override def newBuilder : Builder[Node, NodeSeq]
Creates a list buffer as builder for this class
def text : java.lang.String
abstract def theSeq : Seq[Node]
override def toString : java.lang.String
Need to override string, so that it's not the Function1's string that gets mixed in.
Methods inherited from Seq
companion
Methods inherited from SeqLike
thisCollection, toCollection, lengthCompare, size, isDefinedAt, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseMap, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, updated, +:, :+, padTo, sortWith, sortWith, sortBy, toSeq, indices, view, view, hashCode, findLastIndexOf, equalsWith, containsSlice, projection
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from IterableLike
elements, foreach, forall, exists, find, isEmpty, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, first, firstOption
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix, withFilter
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
protected[this] override def newBuilder : Builder[Node, NodeSeq]
Creates a list buffer as builder for this class

abstract def theSeq : Seq[Node]

def length : Int
Returns the length of the sequence.
Overrides
SeqLike.length

override def iterator : Iterator[Node]
Creates a new iterator over all elements contained in this iterable object.
Returns
the new iterator

def apply(i : Int) : Node
Returns the elements at position `idx`
Overrides
SeqLike.apply

def apply(f : (Node) => Boolean) : NodeSeq

override def equals(x : Any) : Boolean
structural equality (XXX - this shatters any hope of hashCode equality)
Overrides
SeqLike.equals

def \(that : java.lang.String) : NodeSeq
Projection function. Similar to XPath, use this \ "foo" to get a list of all elements of this sequence that are labelled with "foo". Use \ "_" as a wildcard. Use ns \ "@foo" to get the unprefixed attribute "foo". Use ns \ "@{uri}foo" to get the prefixed attribute "pre:foo" whose prefix "pre" is resolved to the namespace "uri". For attribute projections, the resulting NodeSeq attribute values are wrapped in a Group. There is no support for searching a prefixed attribute by its literal prefix. The document order is preserved.
Parameters
that - ...
Returns
...

def \\(that : java.lang.String) : NodeSeq
projection function. Similar to XPath, use this \\ 'foo to get a list of all elements of this sequence that are labelled with "foo". Use \\ "_" as a wildcard. Use ns \\ "@foo" to get the unprefixed attribute "foo". Use ns \\ "@{uri}foo" to get each prefixed attribute "pre:foo" whose prefix "pre" is resolved to the namespace "uri". For attribute projections, the resulting NodeSeq attribute values are wrapped in a Group. There is no support for searching a prefixed attribute by its literal prefix. The document order is preserved.
Parameters
that - ...
Returns
...

override def toString : java.lang.String
Need to override string, so that it's not the Function1's string that gets mixed in.
Overrides
SeqLike.toString

def text : java.lang.String