pub struct NamespaceCleaner;Expand description
OFD 命名空间清理器。
对应 Java: org.ofdrw.reader.tools.NameSpaceCleaner
将 XML 中的命名空间前缀(如 ofd:)移除,使元素名变为
无前缀的本地名称。这在需要与不支持 XML 命名空间的工具交互时有用。
Implementations§
Source§impl NamespaceCleaner
impl NamespaceCleaner
Sourcepub fn remove_prefix(xml: &str, prefix: &str) -> String
pub fn remove_prefix(xml: &str, prefix: &str) -> String
从 XML 字符串中移除指定的命名空间前缀。
将所有 ofd:ElementName 替换为 ElementName。
Sourcepub fn remove_ofd_prefix(xml: &str) -> String
pub fn remove_ofd_prefix(xml: &str) -> String
从 XML 字符串中移除 OFD 命名空间前缀。
Sourcepub fn remove_namespace_declarations(xml: &str) -> String
pub fn remove_namespace_declarations(xml: &str) -> String
从 XML 字符串中移除命名空间声明属性。
移除 xmlns:ofd="..." 形式的属性。
Trait Implementations§
Source§impl Clone for NamespaceCleaner
impl Clone for NamespaceCleaner
Source§fn clone(&self) -> NamespaceCleaner
fn clone(&self) -> NamespaceCleaner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NamespaceCleaner
Auto Trait Implementations§
impl Freeze for NamespaceCleaner
impl RefUnwindSafe for NamespaceCleaner
impl Send for NamespaceCleaner
impl Sync for NamespaceCleaner
impl Unpin for NamespaceCleaner
impl UnsafeUnpin for NamespaceCleaner
impl UnwindSafe for NamespaceCleaner
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