case class XPath(path: List[XPathNode] = Nil) extends Product with Serializable
Class representing an xpath. It can be applied to a NodeSeq to get a NodeSeq located at that path.
- path
A sequence of XPathNodes to recursively walk down the XML tree to the location of the path.
- Alphabetic
- By Inheritance
- XPath
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ++(other: XPath): XPath
Concatenate two XPaths together
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def \(child: String): XPath
Equivalent of "/child" in xpath syntax.
- def \?(regex: Regex): XPath
A regex that matches all nodes that contain the string.
- def \@(attribute: String): XPath
Equivalent of "@attribute" in xpath.
Equivalent of "@attribute" in xpath.
- attribute
The name of the attribute to select
- returns
a new XPath that selects the attribute node with the given name
- def \\(child: String): XPath
Equivalent of "//child" in xpath.
Equivalent of "//child" in xpath.
- child
The name of the label of the descendents.
- returns
a new XPath that selects all descendents with the given tag label.
- def \\?(regex: Regex): XPath
A regex that matches recursively all nodes that contain the string.
- def apply(xml: NodeSeq): NodeSeq
Apply this xpath to a NodeSeq.
Apply this xpath to a NodeSeq.
- xml
The NodeSeq to apply the path to.
- returns
the NodeSeq of the node(s) selected by this xpath.
- def apply(attr: String): XPath
Equivalent of "[@attribute]" in xpath syntax.
Equivalent of "[@attribute]" in xpath syntax.
- attr
The name of the attribute to filter by
- returns
a new XPath that selects only nodes which have the given attribute.
- def apply(attr: String, value: String): XPath
Equivalent of "[@attribute=value]" in xpath syntax.
Equivalent of "[@attribute=value]" in xpath syntax.
- attr
The name of the attribute to filter by
- value
The value of the attribute to filter by
- returns
a new XPath that selects only nodes which have the given value for the given attribute.
- def apply(idx: Int): XPath
Equivalent of "[idx+1]" in xpath syntax, so the first node in this implementation has the index 0.
Equivalent of "[idx+1]" in xpath syntax, so the first node in this implementation has the index 0. Note that, according to the W3C specification, in xpath the index of the first child node is 1 and not 0.
- idx
The index of the node to select.
- returns
a new XPath that selects the node at index
idxin the current selection.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def children: XPath
Equivalent of "/ *" in xpath syntax.
Equivalent of "/ *" in xpath syntax.
- returns
a new XPath that selects all children of the current selection
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lazyRead[A](r: => XmlReader[A]): XmlReader[A]
The same as read but take the reader as a lazy argument so that it can be used in recursive definitions.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val path: List[XPathNode]
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def read[A](implicit reader: XmlReader[A]): XmlReader[A]
Create an XmlReader that reads the node(s) located at this xpath.
Create an XmlReader that reads the node(s) located at this xpath.
- reader
The reader to use on the node at this path
- def readAttribute[A](name: String)(implicit reader: XmlReader[A]): XmlReader[A]
Create an XmlReader that reads an attribute at the current path.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- XPath → AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def with_attr(name: String, value: String): XPath
Equivalent to
with_attr(name, Some(value)) - def with_attr(name: String, value: Option[String] = None): XPath
Equivalent of "[@attribute]" or "[@attribute=value]" in xpath syntax
Equivalent of "[@attribute]" or "[@attribute=value]" in xpath syntax
- name
The name of the attribute to filter by
- value
If supplied filter to only nodes which have this value for the named attribute
- returns
a new XPath that selects only nodes which have an attribute with the given name, and optionally the supplied value.