pub struct ExtensionCaptureContext {
pub element_path: Vec<String>,
pub namespace_context: IndexMap<String, String>,
pub in_extension: bool,
pub extension_depth: usize,
pub extension_buffer: String,
pub current_extension: Option<XmlFragment>,
pub extensions: Extensions,
pub current_line: usize,
pub current_column: usize,
}
Expand description
Extension capture context during parsing
Fields§
§element_path: Vec<String>
Current element path (for location tracking)
namespace_context: IndexMap<String, String>
Namespace context (prefix -> URI mappings)
in_extension: bool
Whether we’re currently inside an unknown element
extension_depth: usize
Depth of unknown element nesting
extension_buffer: String
Buffer for accumulating unknown XML content
current_extension: Option<XmlFragment>
Current extension being built
extensions: Extensions
Extensions collected during parsing
current_line: usize
Current line number for position tracking
current_column: usize
Current column number for position tracking
Implementations§
Source§impl ExtensionCaptureContext
impl ExtensionCaptureContext
Sourcepub fn enter_element(&mut self, element_name: &str)
pub fn enter_element(&mut self, element_name: &str)
Enter an element during parsing
Sourcepub fn exit_element(&mut self) -> Option<String>
pub fn exit_element(&mut self) -> Option<String>
Exit an element during parsing
Sourcepub fn current_path(&self) -> String
pub fn current_path(&self) -> String
Get the current element path as a string
Sourcepub fn add_namespace_declaration(&mut self, prefix: String, uri: String)
pub fn add_namespace_declaration(&mut self, prefix: String, uri: String)
Update namespace context with new declarations
Sourcepub fn should_capture_element(
&self,
_element_name: &str,
namespace_uri: Option<&str>,
) -> bool
pub fn should_capture_element( &self, _element_name: &str, namespace_uri: Option<&str>, ) -> bool
Check if an element should be captured as an extension
Sourcepub fn start_extension_capture(
&mut self,
element_name: &str,
namespace_uri: Option<&str>,
namespace_prefix: Option<&str>,
)
pub fn start_extension_capture( &mut self, element_name: &str, namespace_uri: Option<&str>, namespace_prefix: Option<&str>, )
Start capturing an extension element
Sourcepub fn add_extension_content(&mut self, content: &str)
pub fn add_extension_content(&mut self, content: &str)
Add content to the current extension
Sourcepub fn process_extension_start_tag(&mut self, event: &BytesStart<'_>)
pub fn process_extension_start_tag(&mut self, event: &BytesStart<'_>)
Process an opening tag during extension capture
Sourcepub fn process_extension_end_tag(&mut self, event: &BytesEnd<'_>)
pub fn process_extension_end_tag(&mut self, event: &BytesEnd<'_>)
Process a closing tag during extension capture
Sourcepub fn process_extension_text(&mut self, event: &BytesText<'_>)
pub fn process_extension_text(&mut self, event: &BytesText<'_>)
Process text content during extension capture
Sourcepub fn finish_extension_capture(&mut self)
pub fn finish_extension_capture(&mut self)
Finish capturing the current extension
Sourcepub fn add_processing_instruction(
&mut self,
target: String,
data: Option<String>,
)
pub fn add_processing_instruction( &mut self, target: String, data: Option<String>, )
Add a document-level processing instruction
Sourcepub fn add_comment(&mut self, comment: String)
pub fn add_comment(&mut self, comment: String)
Add a document-level comment
Sourcepub fn add_comment_with_position(
&mut self,
comment: String,
position: CommentPosition,
line_number: Option<usize>,
column_number: Option<usize>,
)
pub fn add_comment_with_position( &mut self, comment: String, position: CommentPosition, line_number: Option<usize>, column_number: Option<usize>, )
Add a position-aware comment
Sourcepub fn into_extensions(self) -> Extensions
pub fn into_extensions(self) -> Extensions
Get the accumulated extensions
Trait Implementations§
Source§impl Clone for ExtensionCaptureContext
impl Clone for ExtensionCaptureContext
Source§fn clone(&self) -> ExtensionCaptureContext
fn clone(&self) -> ExtensionCaptureContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more