Expand description
OXVG uses an ast representation of an XML document for processing SVGs.
As opposed to oxvg_collections, which is for the data types of an SVG document,
oxvg_ast is for the structural types of an SVG document.
§Types
There are three major types for AST representation
node::Nodefor data nodes of an SVG document.element::Elementfor a node that contains SVG element data.- [
attribute::Attribute] for attributes of an SVG element.
§Features
§Parsing
When a parser such as [parse::markup5ever] or [parse::roxmltree] feature flag is enabled,
you can bring the respective parsing library and use that to build an OXVG AST representation.
§Visitors
When you enable the visitor feature flag, you can use the visitor::Visitor trait to
implement a type that can process each node of the document.
§Serialize
When you enable the serialize feature flag, you can use the serialize::Node method on
a node::Node or element::Element in conjunction with xmlwriter::XmlWriter to
write an SVG document to a buffer or string.
Modules§
- arena
- The arena used to allocate nodes
- attribute
- XML element attribute traits.
- class_
list - XML DOM token list traits.
- document
- XML document traits.
- element
- XML element traits.
- error
- Error types.
- node
- XML node traits.
- serialize
- Functions for serializing XML trees
- style
- Style and presentation attribute types.
- visitor
- Visitors for traversing and manipulating nodes of an xml document
- xmlwriter
- A copy of the xmlwriter create, except with some slight modifications.
Macros§
- get_
attribute - Gets the given attribute from the
crate::element::ElementorAttributes - get_
attribute_ mut - Mutably gets the given attribute from the element
- get_
computed_ style_ css - Returns the computed presentation attribute for a computed style
- has_
attribute - Returns whether the given attribute is on the
crate::element::ElementorAttributes - has_
computed_ style_ css - Returns whether the computed presentation attribute exists for a computed style
- is_
attribute - Returns whether the attribute matches the given names
- is_
element - Returns whether the element matches the given names
- remove_
attribute - Removes the given attribute from the element
- set_
attribute - Sets the given attribute to the
crate::element::ElementorAttributes