This package contains element representations that contain the "context" of the element, including the URI of the containing
document. In other words, this package contains element representations like indexed.Elem, except that the document URI
is stored as well in each element.
Below follows a simple example query, using the uniform query API:
// Note the import of package docaware, and not of its members. That is indeed a best practice!import eu.cdevreeze.yaidom.docaware
val docawareBookstoreElem = docaware.Elem(bookstoreElem)
val scalaBookAuthors =
for {
bookElem <- docawareBookstoreElem \ 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 docaware.Elems
(replacing docawareBookstoreElem by bookstoreElem)!
This package contains element representations that contain the "context" of the element, including the URI of the containing document. In other words, this package contains element representations like
indexed.Elem
, except that the document URI is stored as well in each element.Below follows a simple example query, using the uniform query API:
The query for Scala book authors would have been exactly the same if normal
Elem
s had been used instead ofdocaware.Elem
s (replacingdocawareBookstoreElem
bybookstoreElem
)!