Document

@SerialVersionUID(-2289320563321795109L)
class Document extends NodeSeq with Serializable

A document information item (according to InfoSet spec). The comments are copied from the Infoset spec, only augmented with some information on the Scala types for definitions that might have no value. Also plays the role of an XMLEvent for pull parsing.

Value members

Concrete methods

override def canEqual(other: Any): Boolean
Definition Classes

An unordered set of notation information items, one for each notation declared in the DTD. If any notation is multiply declared, this property has no value.

An unordered set of notation information items, one for each notation declared in the DTD. If any notation is multiply declared, this property has no value.

An unordered set of unparsed entity information items, one for each unparsed entity declared in the DTD.

An unordered set of unparsed entity information items, one for each unparsed entity declared in the DTD.

Inherited methods

final def ++(suffix: Seq[Node]): NodeSeq
Inherited from:
ScalaVersionSpecificNodeSeq
final def ++[B >: Node](suffix: IterableOnce[B]): Seq[B]
Inherited from:
IterableOps
final override def ++:[B >: Node](prefix: IterableOnce[B]): Seq[B]
Definition Classes
Inherited from:
SeqOps
final def +:[B >: Node](elem: B): Seq[B]
Inherited from:
SeqOps
final def :+[B >: Node](elem: B): Seq[B]
Inherited from:
SeqOps
final def :++[B >: Node](suffix: IterableOnce[B]): Seq[B]
Inherited from:
SeqOps
def \(that: String): NodeSeq

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" of this;
  • 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
def \@(attributeName: String): String

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
def \\(that: String): 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", includingthis`;
  • this \\ "_" to get a list of all elements (wildcard), including this;
  • 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
override def andThen[C](k: Node => C): PartialFunction[Int, C]
Definition Classes
Inherited from:
PartialFunction
def appended(base: Node): NodeSeq
Inherited from:
ScalaVersionSpecificNodeSeq
override def appended[B >: Node](elem: B): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
ScalaVersionSpecificNodeSeq
override def appendedAll[B >: Node](suffix: IterableOnce[B]): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
NodeSeq
def apply(i: Int): Node
Inherited from:
NodeSeq
def applyOrElse[A1 <: Int, B1 >: Node](x: A1, default: A1 => B1): B1
Inherited from:
PartialFunction
override def collect[B](pf: PartialFunction[Node, B]): Seq[B]
Inherited from:
IterableOnceOps
Inherited from:
SeqOps
def compose[A](g: A => Int): A => Node
Inherited from:
Function1
Inherited from:
ScalaVersionSpecificNodeSeq
final override def concat[B >: Node](suffix: IterableOnce[B]): Seq[B]
Definition Classes
Inherited from:
SeqOps
def contains[A1 >: Node](elem: A1): Boolean
Inherited from:
SeqOps
def containsSlice[B >: Node](that: Seq[B]): Boolean
Inherited from:
SeqOps
def copyToArray[B >: Node](xs: Array[B], start: Int, len: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: Node](xs: Array[B], start: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: Node](xs: Array[B]): Int
Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (Node, B) => Boolean): Boolean
Inherited from:
IterableOnceOps
def corresponds[B](that: Seq[B])(p: (Node, B) => Boolean): Boolean
Inherited from:
SeqOps
def count(p: Node => Boolean): Int
Inherited from:
IterableOnceOps
override def diff[B >: Node](that: Seq[B]): NodeSeq
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
SeqOps
override def distinctBy[B](f: Node => B): NodeSeq
def drop(n: Int): NodeSeq
Inherited from:
IterableOps
override def dropRight(n: Int): NodeSeq
Inherited from:
IterableOps
override def empty: NodeSeq
Definition Classes
ScalaVersionSpecificNodeSeq -> IterableOps
Inherited from:
ScalaVersionSpecificNodeSeq
def endsWith[B >: Node](that: Iterable[B]): Boolean
Inherited from:
SeqOps
override def equals(other: Any): Boolean
Definition Classes
Equality -> Equals -> Any
Inherited from:
Equality
Inherited from:
IterableOnceOps
override def filter(pred: Node => Boolean): NodeSeq
def find(p: Node => Boolean): Option[Node]
Inherited from:
IterableOnceOps
Inherited from:
SeqOps
Inherited from:
ScalaVersionSpecificNodeSeq
override def flatMap[B](f: Node => IterableOnce[B]): Seq[B]
override def flatten[B](implicit toIterableOnce: Node => IterableOnce[B]): Seq[B]
def fold[A1 >: Node](z: A1)(op: (A1, A1) => A1): A1
Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, Node) => B): B
Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (Node, B) => B): B
Inherited from:
IterableOnceOps
Inherited from:
IterableOnceOps
def foreach[U](f: Node => U): Unit
Inherited from:
IterableOnceOps
override def fromSpecific(coll: IterableOnce[Node]): NodeSeq
Definition Classes
ScalaVersionSpecificNodeSeq -> IterableOps
Inherited from:
ScalaVersionSpecificNodeSeq
def groupBy[K](f: Node => K): Map[K, NodeSeq]
Inherited from:
IterableOps
def groupMap[K, B](key: Node => K)(f: Node => B): Map[K, Seq[B]]
Inherited from:
IterableOps
def groupMapReduce[K, B](key: Node => K)(f: Node => B)(reduce: (B, B) => B): Map[K, B]
Inherited from:
IterableOps
Inherited from:
IterableOps
override def hashCode(): Int

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.

Definition Classes
Equality -> Any
Inherited from:
Equality
def head: Node
Inherited from:
IterableOps
Inherited from:
IterableOps
@deprecatedOverriding(message = "Override indexOf(elem, from) instead - indexOf(elem) calls indexOf(elem, 0)", since = "2.13.0")
def indexOf[B >: Node](elem: B): Int
Inherited from:
SeqOps
def indexOf[B >: Node](elem: B, from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexOfSlice(that, from) instead - indexOfSlice(that) calls indexOfSlice(that, 0)", since = "2.13.0")
def indexOfSlice[B >: Node](that: Seq[B]): Int
Inherited from:
SeqOps
def indexOfSlice[B >: Node](that: Seq[B], from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexWhere(p, from) instead - indexWhere(p) calls indexWhere(p, 0)", since = "2.13.0")
Inherited from:
SeqOps
def indexWhere(p: Node => Boolean, from: Int): Int
Inherited from:
SeqOps
Inherited from:
SeqOps
Inherited from:
IterableOps
Inherited from:
IterableOps
override def intersect[B >: Node](that: Seq[B]): NodeSeq
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
SeqOps
override def isEmpty: Boolean
Definition Classes
Inherited from:
SeqOps
Definition Classes
Inherited from:
IterableOps
Definition Classes
Inherited from:
Seq
override def iterator: Iterator[Node]
Definition Classes
Inherited from:
NodeSeq
Inherited from:
IterableOnce
def last: Node
Inherited from:
IterableOps
def lastIndexOf[B >: Node](elem: B, end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexOfSlice(that, end) instead - lastIndexOfSlice(that) calls lastIndexOfSlice(that, Int.MaxValue)", since = "2.13.0")
def lastIndexOfSlice[B >: Node](that: Seq[B]): Int
Inherited from:
SeqOps
def lastIndexOfSlice[B >: Node](that: Seq[B], end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexWhere(p, end) instead - lastIndexWhere(p) calls lastIndexWhere(p, Int.MaxValue)", since = "2.13.0")
Inherited from:
SeqOps
def lastIndexWhere(p: Node => Boolean, end: Int): Int
Inherited from:
SeqOps
Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[Node, B, Document]
Inherited from:
Iterable
def length: Int
Inherited from:
NodeSeq
def lengthCompare(that: Iterable[_]): Int
Inherited from:
SeqOps
def lengthCompare(len: Int): Int
Inherited from:
SeqOps
Inherited from:
SeqOps
def lift: Int => Option[Node]
Inherited from:
PartialFunction
def map(f: Node => Node): NodeSeq
Inherited from:
ScalaVersionSpecificNodeSeq
override def map[B](f: Node => B): Seq[B]
def max[B >: Node](implicit ord: Ordering[B]): Node
Inherited from:
IterableOnceOps
def maxBy[B](f: Node => B)(implicit cmp: Ordering[B]): Node
Inherited from:
IterableOnceOps
def maxByOption[B](f: Node => B)(implicit cmp: Ordering[B]): Option[Node]
Inherited from:
IterableOnceOps
def maxOption[B >: Node](implicit ord: Ordering[B]): Option[Node]
Inherited from:
IterableOnceOps
def min[B >: Node](implicit ord: Ordering[B]): Node
Inherited from:
IterableOnceOps
def minBy[B](f: Node => B)(implicit cmp: Ordering[B]): Node
Inherited from:
IterableOnceOps
def minByOption[B](f: Node => B)(implicit cmp: Ordering[B]): Option[Node]
Inherited from:
IterableOnceOps
def minOption[B >: Node](implicit ord: Ordering[B]): Option[Node]
Inherited from:
IterableOnceOps
final def mkString: String
Inherited from:
IterableOnceOps
final def mkString(sep: String): String
Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String
Inherited from:
IterableOnceOps
Definition Classes
ScalaVersionSpecificNodeSeq -> IterableOps
Inherited from:
ScalaVersionSpecificNodeSeq
@deprecatedOverriding(message = "nonEmpty is defined as !isEmpty; override isEmpty instead", since = "2.13.0")
Inherited from:
IterableOnceOps
def orElse[A1 <: Int, B1 >: Node](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
Inherited from:
PartialFunction
override def padTo[B >: Node](len: Int, elem: B): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def partition(p: Node => Boolean): (NodeSeq, NodeSeq)
override def partitionMap[A1, A2](f: Node => Either[A1, A2]): (Seq[A1], Seq[A2])
override def patch[B >: Node](from: Int, other: IterableOnce[B], replaced: Int): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
SeqOps
def prepended(base: Node): NodeSeq
Inherited from:
ScalaVersionSpecificNodeSeq
override def prepended[B >: Node](elem: B): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
ScalaVersionSpecificNodeSeq
override def prependedAll[B >: Node](prefix: IterableOnce[B]): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
def product[B >: Node](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
def reduce[B >: Node](op: (B, B) => B): B
Inherited from:
IterableOnceOps
def reduceLeft[B >: Node](op: (B, Node) => B): B
Inherited from:
IterableOnceOps
def reduceLeftOption[B >: Node](op: (B, Node) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceOption[B >: Node](op: (B, B) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceRight[B >: Node](op: (Node, B) => B): B
Inherited from:
IterableOnceOps
def reduceRightOption[B >: Node](op: (Node, B) => B): Option[B]
Inherited from:
IterableOnceOps
Inherited from:
SeqOps
Inherited from:
SeqOps
protected def reversed: Iterable[Node]
Inherited from:
IterableOnceOps
def runWith[U](action: Node => U): Int => Boolean
Inherited from:
PartialFunction
Inherited from:
SeqOps
Inherited from:
SeqOps
def scan[B >: Node](z: B)(op: (B, B) => B): Seq[B]
Inherited from:
IterableOps
override def scanLeft[B](z: B)(op: (B, Node) => B): Seq[B]
def scanRight[B](z: B)(op: (Node, B) => B): Seq[B]
Inherited from:
IterableOps
def search[B >: Node](elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): SearchResult
Inherited from:
SeqOps
def search[B >: Node](elem: B)(implicit ord: Ordering[B]): SearchResult
Inherited from:
SeqOps
def segmentLength(p: Node => Boolean, from: Int): Int
Inherited from:
SeqOps
final def segmentLength(p: Node => Boolean): Int
Inherited from:
SeqOps
final override def size: Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(that: Iterable[_]): Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(otherSize: Int): Int
Definition Classes
Inherited from:
SeqOps
Inherited from:
IterableOps
def slice(from: Int, until: Int): NodeSeq
Inherited from:
IterableOps
def sliding(size: Int, step: Int): Iterator[NodeSeq]
Inherited from:
IterableOps
Inherited from:
IterableOps
def sortBy[B](f: Node => B)(implicit ord: Ordering[B]): NodeSeq
Inherited from:
SeqOps
def sortWith(lt: (Node, Node) => Boolean): NodeSeq
Inherited from:
SeqOps
override def sorted[B >: Node](implicit ord: Ordering[B]): NodeSeq
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def splitAt(n: Int): (NodeSeq, NodeSeq)
Definition Classes
Inherited from:
IterableOps
def startsWith[B >: Node](that: IterableOnce[B], offset: Int): Boolean
Inherited from:
SeqOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[Node, S]): S
Inherited from:
IterableOnce
Inherited from:
Equality
override def strict_==(other: Equality): Boolean
Definition Classes
Inherited from:
NodeSeq
def sum[B >: Node](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
Inherited from:
IterableOps
Inherited from:
IterableOps
def take(n: Int): NodeSeq
Inherited from:
IterableOps
override def takeRight(n: Int): NodeSeq
Inherited from:
IterableOps
override def tapEach[U](f: Node => U): NodeSeq
Inherited from:
NodeSeq
def to[C1](factory: Factory[Node, C1]): C1
Inherited from:
IterableOnceOps
def toArray[B >: Node : ClassTag]: Array[B]
Inherited from:
IterableOnceOps
final def toBuffer[B >: Node]: Buffer[B]
Inherited from:
IterableOnceOps
final def toIterable: Document
Inherited from:
Iterable
Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: Node <:< (K, V)): Map[K, V]
Inherited from:
IterableOnceOps
final override def toSeq: Document
Definition Classes
Inherited from:
Seq
def toSet[B >: Node]: Set[B]
Inherited from:
IterableOnceOps
override def toString(): String
Definition Classes
NodeSeq -> Seq -> Function1 -> Iterable -> Any
Inherited from:
NodeSeq
Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: Node => Iterable[B]): Seq[Seq[B]]
Inherited from:
IterableOps
Inherited from:
PartialFunction
override def unzip[A1, A2](implicit asPair: Node => (A1, A2)): (Seq[A1], Seq[A2])
override def unzip3[A1, A2, A3](implicit asTriple: Node => (A1, A2, A3)): (Seq[A1], Seq[A2], Seq[A3])
override def updated[B >: Node](index: Int, elem: B): Seq[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def view: SeqView[Node]
Definition Classes
Inherited from:
SeqOps
Inherited from:
IterableOps
final def xml_!=(other: Any): Boolean
Inherited from:
Equality
final def xml_==(other: Any): Boolean
Inherited from:
Equality
Inherited from:
NodeSeq
override def zip[B](that: IterableOnce[B]): Seq[(Node, B)]
def zipAll[A1 >: Node, B](that: Iterable[B], thisElem: A1, thatElem: B): Seq[(A1, B)]
Inherited from:
IterableOps

Deprecated and Inherited methods

@inline @deprecated(message = "Use foldLeft instead of /:", since = "2.13.0")
final def /:[B](z: B)(op: (B, Node) => B): B
Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use foldRight instead of :\\", since = "2.13.0")
final def :\[B](z: B)(op: (Node, B) => B): B
Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
@deprecated(message = "`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.", since = "2.13.0")
def aggregate[B](z: => B)(seqop: (B, Node) => B, combop: (B, B) => B): B
Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps
@inline @deprecatedOverriding(message = "Use iterableFactory instead", since = "2.13.0") @deprecated(message = "Use iterableFactory instead", since = "2.13.0")
Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
@inline @deprecated(message = "Use `dest ++= coll` instead", since = "2.13.0")
final def copyToBuffer[B >: Node](dest: Buffer[B]): Unit
Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
@deprecated(message = "Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)", since = "2.13.0")
Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use segmentLength instead of prefixLength", since = "2.13.0")
final def prefixLength(p: Node => Boolean): Int
Deprecated
[Since version 2.13.0] Use segmentLength instead of prefixLength
Inherited from:
SeqOps
@deprecated(message = "Use coll instead of repr in a collection implementation, use the collection value itself from the outside", since = "2.13.0")
final def repr: NodeSeq
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(message = "Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)", since = "2.13.0")
def reverseMap[B](f: Node => B): Seq[B]
Deprecated
[Since version 2.13.0] Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)
Inherited from:
SeqOps
@deprecated(message = "Iterable.seq always returns the iterable itself", since = "2.13.0")
Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
@inline @deprecated(message = "Use .iterator instead of .toIterator", since = "2.13.0")
Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use .to(LazyList) instead of .toStream", since = "2.13.0")
final def toStream: Stream[Node]
Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
@deprecated(message = "Use toIterable instead", since = "2.13.0")
Deprecated
[Since version 2.13.0] Use toIterable instead
Inherited from:
IterableOps
@inline @deprecated(message = "Use `concat` instead", since = "2.13.0")
final def union[B >: Node](that: Seq[B]): Seq[B]
Deprecated
[Since version 2.13.0] Use `concat` instead
Inherited from:
SeqOps
@deprecated(message = "Use .view.slice(from, until) instead of .view(from, until)", since = "2.13.0")
def view(from: Int, until: Int): View[Node]
Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps

Concrete fields

  1. This property is not strictly speaking part of the infoset of the document. Rather it is an indication of whether the processor has read the complete DTD. Its value is a boolean. If it is false, then certain properties (indicated in their descriptions below) may be unknown. If it is true, those properties are never unknown.

The base URI of the document entity.

The base URI of the document entity.

An ordered list of child information items, in document order. The list contains exactly one element information item. The list also contains one processing instruction information item for each processing instruction outside the document element, and one comment information item for each comment outside the document element. Processing instructions and comments within the DTD are excluded. If there is a document type declaration, the list also contains a document type declaration information item.

An ordered list of child information items, in document order. The list contains exactly one element information item. The list also contains one processing instruction information item for each processing instruction outside the document element, and one comment information item for each comment outside the document element. Processing instructions and comments within the DTD are excluded. If there is a document type declaration, the list also contains a document type declaration information item.

The element information item corresponding to the document element.

The element information item corresponding to the document element.

var dtd: DTD

The dtd that comes with the document, if any

The dtd that comes with the document, if any

The name of the character encoding scheme in which the document entity is expressed.

The name of the character encoding scheme in which the document entity is expressed.

An indication of the standalone status of the document, either true or false. This property is derived from the optional standalone document declaration in the XML declaration at the beginning of the document entity, and has no value (None) if there is no standalone document declaration.

An indication of the standalone status of the document, either true or false. This property is derived from the optional standalone document declaration in the XML declaration at the beginning of the document entity, and has no value (None) if there is no standalone document declaration.

A string representing the XML version of the document. This property is derived from the XML declaration optionally present at the beginning of the document entity, and has no value (None) if there is no XML declaration.

A string representing the XML version of the document. This property is derived from the XML declaration optionally present at the beginning of the document entity, and has no value (None) if there is no XML declaration.