A wrapper around Either[SchemaError, Chunk[Xml]] that provides fluent chaining for XML navigation and querying operations.
XmlSelection enables a fluent API style for navigating through XML structures:
xml.get("users").elements.apply(0).get("name").texts
The selection can contain zero, one, or multiple XML values, supporting both single-value navigation and multi-value queries.
Attributes
- Companion
- object
- Source
- XmlSelection.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Combines two selections, concatenating their values.
Returns all selected values condensed into a single Xml. If there are multiple values, wraps them in an element. Fails if the selection is empty or an error.
Returns all selected values condensed into a single Xml. If there are multiple values, wraps them in an element. Fails if the selection is empty or an error.
Attributes
- Source
- XmlSelection.scala
Returns any single value from the selection. Fails if the selection is empty or an error.
Returns any single value from the selection. Fails if the selection is empty or an error.
Attributes
- Source
- XmlSelection.scala
Navigates to the nth child (any type).
Narrows the single selected value to the specified XML type. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Narrows the single selected value to the specified XML type. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Attributes
- Source
- XmlSelection.scala
Keeps only CDATA values.
Keeps only comment values.
Navigates to all descendant elements with the given name (recursive search). Does not include the starting element itself, only its descendants.
Navigates to all descendant elements with the given name (recursive search). Does not include the starting element itself, only its descendants.
Attributes
- Source
- XmlSelection.scala
Keeps only element values.
Returns the error if this is a failure, otherwise None.
Filters selected values based on a predicate.
FlatMaps a function over all selected values, combining results.
FlatMaps a function over all selected values, combining results.
Attributes
- Source
- XmlSelection.scala
Navigates to child elements with the given name.
Navigates using a DynamicOptic path.
Returns this selection's values, or the default on failure.
Returns true if this selection is empty (no values or error).
Returns true if the selection is a failure.
Returns true if the selection is successful (contains values).
Maps a function over all selected values.
Returns true if this selection contains at least one value.
Returns the single selected value or fails if there are 0 or more than 1 values.
Returns the single selected value or fails if there are 0 or more than 1 values.
Attributes
- Source
- XmlSelection.scala
Returns this selection if successful, otherwise the alternative.
Returns this selection if successful, otherwise the alternative.
Attributes
- Source
- XmlSelection.scala
Keeps only processing instruction values.
Returns the number of selected values (0 on error).
Extracts text content from the single selected element. For Text/CData nodes, returns the content directly. For Element nodes, returns concatenated text of all child text nodes.
Extracts text content from the single selected element. For Text/CData nodes, returns the content directly. For Element nodes, returns concatenated text of all child text nodes.
Attributes
- Source
- XmlSelection.scala
Concatenates all text content from the selection. Never fails; returns empty string if no text is found.
Concatenates all text content from the selection. Never fails; returns empty string if no text is found.
Attributes
- Source
- XmlSelection.scala
Keeps only text values.
Returns all selected values as an XML element with children.
Returns the selected values as a Chunk, or an empty Chunk on failure.
Returns the selected values as a Chunk, or an empty Chunk on failure.
Attributes
- Source
- XmlSelection.scala
Extracts the underlying Scala value from the single selected XML value. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Extracts the underlying Scala value from the single selected XML value. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Attributes
- Source
- XmlSelection.scala
Returns the selected values if successful, otherwise None.
Inherited methods
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala