pub struct XmlContext { /* private fields */ }Expand description
XPath evaluation context.
Holds namespace bindings and can be reused for multiple evaluations.
Implementations§
Source§impl XmlContext
impl XmlContext
Sourcepub fn new(doc: &XmlDocument) -> Self
pub fn new(doc: &XmlDocument) -> Self
Creates a context for the given document.
Sourcepub fn register_namespace(&mut self, prefix: &str, uri: &str) -> Result<()>
pub fn register_namespace(&mut self, prefix: &str, uri: &str) -> Result<()>
Registers a namespace binding.
Sourcepub fn evaluate(&self, xpath: &str) -> Result<XPathResult>
pub fn evaluate(&self, xpath: &str) -> Result<XPathResult>
Evaluates an XPath expression.
Sourcepub fn evaluate_from(&self, xpath: &str, node: &XmlNode) -> Result<XPathResult>
pub fn evaluate_from(&self, xpath: &str, node: &XmlNode) -> Result<XPathResult>
Evaluates an XPath expression relative to a context node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XmlContext
impl !RefUnwindSafe for XmlContext
impl Send for XmlContext
impl Sync for XmlContext
impl Unpin for XmlContext
impl UnsafeUnpin for XmlContext
impl !UnwindSafe for XmlContext
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