eu.cdevreeze.yaidom

indexed

package indexed

This package contains element representations that contain the "context" of the element. That is, the elements in this package are pairs of a root element and a path (to the actual element itself). The "context" of an element also contains an optional document URI.

An example of where such a representation can be useful is XML Schema. After all, to interpret an element definition in an XML schema, we need context of the element definition to determine the target namespace, or to determine whether the element definition is top level, etc.

Below follows a simple example query, using the uniform query API:

// Note the import of package indexed, and not of its members. That is indeed a best practice!
import eu.cdevreeze.yaidom.indexed

val indexedBookstoreElem = indexed.Elem(bookstoreElem)

val scalaBookAuthors =
  for {
    bookElem <- indexedBookstoreElem \ EName("{http://bookstore/book}Book")
    if (bookElem \@ EName("ISBN")) == Some("978-0981531649")
    authorElem <- bookElem \\ EName("{http://bookstore/author}Author")
  } yield authorElem

The query for Scala book authors would have been exactly the same if normal Elems had been used instead of indexed.Elems (replacing indexedBookstoreElem by bookstoreElem)!

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. indexed
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. final class Document extends IndexedDocument[simple.Elem] with Immutable

    IndexedDocument, containing an "indexed" document element with simple elements as underlying elements.

  2. type Elem = IndexedScopedElem[simple.Elem]

  3. final class IndexedClarkElem[U <: ClarkElemApi[U]] extends queryapi.Nodes.Elem with IndexedClarkElemLike[IndexedClarkElem[U], U]

    An element within its context.

  4. trait IndexedClarkElemApi[E <: IndexedClarkElemApi[E, U], U <: ClarkElemApi[U]] extends ClarkElemApi[E]

    Abstract API for "indexed elements".

  5. trait IndexedClarkElemLike[E <: IndexedClarkElemLike[E, U], U <: ClarkElemApi[U]] extends IndexedClarkElemApi[E, U] with ClarkElemLike[E]

    Partial implementation of the abstract API for "indexed elements".

  6. abstract class IndexedDocument[U <: ScopedElemApi[U]] extends DocumentApi[IndexedScopedElem[U]] with Immutable

    Document, containing an "indexed" document element.

  7. final class IndexedScopedElem[U <: ScopedElemApi[U]] extends queryapi.Nodes.Elem with IndexedScopedElemLike[IndexedScopedElem[U], U]

    Indexed Scoped element.

  8. trait IndexedScopedElemApi[E <: IndexedScopedElemApi[E, U], U <: ScopedElemApi[U]] extends IndexedClarkElemApi[E, U] with ScopedElemApi[E]

    Abstract API for "indexed Scoped elements".

  9. trait IndexedScopedElemLike[E <: IndexedScopedElemLike[E, U], U <: ScopedElemApi[U]] extends IndexedScopedElemApi[E, U] with IndexedClarkElemLike[E, U] with ScopedElemLike[E]

    Partial implementation of the abstract API for "indexed Scoped elements".

Value Members

  1. object Document

  2. object Elem

    Factory object for Elem instances, where Elem is a type alias for IndexedScopedElem[simple.Elem].

  3. object IndexedClarkElem

  4. object IndexedClarkElemApi

  5. object IndexedScopedElem

  6. object IndexedScopedElemApi

Inherited from AnyRef

Inherited from Any

Ungrouped