pub struct XmlConversionConfig { /* private fields */ }Expand description
Holds the configuration for mapping a specific XML format to STAM
Implementations§
Source§impl XmlConversionConfig
impl XmlConversionConfig
pub fn new() -> Self
pub fn resolve_baseelements(&mut self) -> Result<(), XmlConversionError>
Sourcepub fn from_toml_str(tomlstr: &str) -> Result<Self, String>
pub fn from_toml_str(tomlstr: &str) -> Result<Self, String>
Parse the configuration from a TOML string (load the data from file yourself).
pub fn with_debug(self, value: bool) -> Self
Sourcepub fn with_provenance(self, value: bool) -> Self
pub fn with_provenance(self, value: bool) -> Self
Add provenance information pointing each annotation to the appropriate node in the XML source files where it came from (translates into XPathSelector in Web Annotation output)
Sourcepub fn with_prefix(
self,
prefix: impl Into<String>,
namespace: impl Into<String>,
) -> Self
pub fn with_prefix( self, prefix: impl Into<String>, namespace: impl Into<String>, ) -> Self
Register an XML namespace with prefix
Sourcepub fn with_id_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_id_prefix(self, prefix: impl Into<String>) -> Self
A prefix to assign when setting annotation IDs, within this string you can use the special variable {resource} to use the resource ID.
Sourcepub fn with_id_strip_suffix(self, suffix: impl Into<String>) -> Self
pub fn with_id_strip_suffix(self, suffix: impl Into<String>) -> Self
A suffix to strip when assigning annotation IDs
Sourcepub fn with_inject_dtd(self, dtd: impl Into<String>) -> Self
pub fn with_inject_dtd(self, dtd: impl Into<String>) -> Self
Inject a DTD (for XML entity resolution)
Sourcepub fn with_whitespace(self, handling: XmlWhitespaceHandling) -> Self
pub fn with_whitespace(self, handling: XmlWhitespaceHandling) -> Self
Set default whitespace handling
Sourcepub fn with_element<F>(self, expression: &str, setup: F) -> Self
pub fn with_element<F>(self, expression: &str, setup: F) -> Self
Set an element configuration
pub fn add_context(&mut self, key: impl Into<String>, value: Value)
pub fn debug(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for XmlConversionConfig
impl<'de> Deserialize<'de> for XmlConversionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for XmlConversionConfig
impl RefUnwindSafe for XmlConversionConfig
impl Send for XmlConversionConfig
impl Sync for XmlConversionConfig
impl Unpin for XmlConversionConfig
impl UnwindSafe for XmlConversionConfig
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