scala.xml

class NodeSeq

[source: scala/xml/NodeSeq.scala]

abstract class NodeSeq
extends Sequence[Node] with SequenceTemplate[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
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 : Sequence[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 Sequence
companion, hashCode
Methods inherited from SequenceTemplate
lengthCompare, size, isDefinedAt, zip, zipAll, zipWithIndex, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, toSequence, indices, view, view, sortWith, findLastIndexOf, slice, equalsWith, containsSlice, projection
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from IterableTemplate
elements, foreach, isEmpty, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, first, firstOption, toSeq
Methods inherited from TraversableClass
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableTemplate
thisCollection, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toList, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix
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 : Sequence[Node]

def length : Int
Returns the length of the sequence.
Returns
the sequence length.
Overrides
SequenceTemplate.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
SequenceTemplate.apply

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

override def equals(x : Any) : Boolean
structural equality
Overrides
SequenceTemplate.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
SequenceTemplate.toString

def text : java.lang.String