Releases: DraviaVemal/xml_rs
v1.0.3-alpha.1
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
- 6025272 Add FUNDING.yml file with GitHub funding information
- 3afe5a5 Xpath start
- 522b222 Static code update
- 960adc6 Access modifer update
- 377367c Test Case Update
- 3300b3d - Adding AI comments to new methods
- 2b1f86d - Adding new method without doc
- 7079a2f Test Case Update
- 884532a Unit test Fix
- d598df1 # Update
See More
- 5b9a736 Escape string update and child element counter
- a5d441c Readme update
- 2ac1268 Build script fix
- 0379039 readme and version update [skip ci]
This list of changes was auto generated.
v1.0.2
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
- 2823bb0 Release v1.0.2
This list of changes was auto generated.
v1.0.2-alpha.4
v1.0.2-alpha.3
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
- 7079a2f Test Case Update
This list of changes was auto generated.
v1.0.2-alpha.2
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
This list of changes was auto generated.
v1.0.2-alpha.1
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
- 5b9a736 Escape string update and child element counter
- a5d441c Readme update
- 2ac1268 Build script fix
- 0379039 readme and version update [skip ci]
This list of changes was auto generated.
v1.0.0
Release Notes - draviavemal-xml_rs v1.0.0
I'm excited to announce the first stable release of draviavemal-xml_rs, a high-performance, memory-efficient XML DOM parser for Rust. As a solo developer, this release marks the culmination of my extensive development and testing to provide a robust XML parsing and manipulation library for Rust developers.
π Highlights
- Full DOM Implementation: Complete XML Document Object Model support with element, attribute, and text manipulation
- Namespace-Aware Parsing: Proper handling of XML namespaces with prefix-to-URI resolution
- Order-Preserving Attributes: Maintains the original order of XML attributes
- Round-Trip Safe: Serialization preserves namespace prefixes, attribute order, and original structure
- Low Memory Footprint: Efficient ID-based tree model (similar to arena allocation)
- Zero Unsafe Code: Implemented entirely in safe Rust
β¨ Features
XML Parsing and Serialization
- UTF-8 Focused: Optimized for the most common XML encoding
- XML Declaration Support: Reads version, encoding, and standalone attributes
- Line Break Normalization: Converts
\r\nand\rto\nfor consistent handling - Special Character Handling: Proper escaping and unescaping of XML special characters (
<,>,&,",') - Comment Preservation: Maintains comment nodes in the document
Namespace Support
- Full Namespace Resolution: Correctly handles namespaced elements and attributes
- QName Parsing: Properly resolves
{namespace_uri, local_name}format - Namespace Stacks: Maintains nested namespace contexts
- Alias Renaming: Ability to modify namespace prefixes while preserving URIs
Document Manipulation
- Element Creation and Modification: Comprehensive API for building and editing XML documents
- Attribute Manipulation: Add, remove, and modify element attributes
- Child Element Management: Find, add, and remove child elements
- Content Operations: Add text, comments, and mixed content to elements
Search and Navigation
- Element Finding: Find elements by tag name or attributes
- Attribute Searching: Locate elements with specific attribute values
- Namespace-Aware Queries: Search with or without namespace awareness
π API Documentation
The library provides a clean, well-documented API organized into several key components:
Core Types
XmlDocument: The container for the entire XML document treeXmlElement: Represents a single XML element with its attributes and contentsXmlAttribute: Represents an XML attribute with name and valueXmlNamespace: Manages namespace prefix-to-URI mappingsXmlElementContentType: Represents different types of content (Element, Text, Comment)
Serialization/Deserialization
XmlDeserializer: Parses XML text into a document object modelXmlSerializer: Converts document object models back to XML text
π§ Technical Details
- Memory Model: Uses a node ID system with centralized storage for efficient memory use
- Error Handling: Comprehensive error reporting using the
anyhowcrate - Validation: XML name validation according to W3C specifications
- Performance: Optimized for both parsing and manipulation operations
π¦ Installation
Add to your Cargo.toml:
[dependencies]
draviavemal-xml_rs = "1.0.0"Or use Cargo:
cargo add draviavemal-xml_rsπ Basic Usage
use draviavemal_xml_rs::{XmlDeserializer, XmlSerializer, XmlDocument, XmlAttribute};
// Parse XML from a string
let xml_string = r#"<root><child id="1">Text content</child></root>"#;
let mut document = XmlDeserializer::vec_to_xml_doc_tree(xml_string.as_bytes().to_vec())
.expect("Failed to parse XML");
// Access elements
let root_id = document.get_root_id();
let child_id = document.find_first_child(root_id, "child")
.expect("Failed to find child")
.expect("No child element found");
// Create new elements
let new_child_id = document.append_child_element_mut(
root_id,
"new-child",
Some(vec![XmlAttribute::new("type".to_string(), "example".to_string())])
).expect("Failed to create new child");
// Serialize back to XML
let xml_bytes = XmlSerializer::xml_tree_to_vec(&mut document)
.expect("Failed to serialize XML");
let xml_output = String::from_utf8(xml_bytes).expect("Invalid UTF-8");π License
- Open Source: AGPL-3.0 license for non-commercial and open source use
- Commercial: Separate licensing available via sponsorship
π Future Plans
As I continue to develop this library, I plan to focus on:
- Performance optimizations
- Additional convenience APIs
- XPath-like querying capabilities
- Schema validation support
- Enhanced documentation and examples
I welcome feedback and feature requests to help prioritize future development.
For more information, visit GitHub Repository or Documentation.
v0.1.0-alpha.1
Auto Generate Release By DevOps Tool to Simplify Development
Changes:
- 7690fee - Adding direct file read and write methods
- 59c4512 Test Setup update
- d7e14bf readme update
- b1e151b Reorganizing crate for test setup and link to openxml-office
This list of changes was auto generated.