pub struct Documents { /* private fields */ }Expand description
A collection of XML documents as can be used by XPath and XSLT.
This collection can be prepared before any XPath or XSLT processing begins.
Alternatively this collection can be added to incrementally during
processing using the fn:doc function for instance. Once a document under
a URL is present, it won’t be changed.
Implementations§
Source§impl Documents
impl Documents
Sourcepub fn add_string(
&mut self,
uri: &IriStr,
xml: &str,
) -> Result<DocumentHandle, DocumentsError>
pub fn add_string( &mut self, uri: &IriStr, xml: &str, ) -> Result<DocumentHandle, DocumentsError>
Load a string as an XML document. Designate it with a URI.
Something may go wrong during processing of the XML document; this is
a xot::Error.
Sourcepub fn add_string_without_uri(
&mut self,
xml: &str,
) -> Result<DocumentHandle, DocumentsError>
pub fn add_string_without_uri( &mut self, xml: &str, ) -> Result<DocumentHandle, DocumentsError>
Load a string as an XML document without designating it with a URI.
Something may go wrong during processing of the XML document; this is
a xot::Error.
Sourcepub fn document_node(&self, handle: DocumentHandle) -> Option<Node>
pub fn document_node(&self, handle: DocumentHandle) -> Option<Node>
Given a handle give back the document node
Sourcepub fn documents(&self) -> &DocumentsRef
pub fn documents(&self) -> &DocumentsRef
Get a reference to the documents
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Documents
impl !RefUnwindSafe for Documents
impl !Send for Documents
impl !Sync for Documents
impl Unpin for Documents
impl !UnwindSafe for Documents
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more