Module spreadsheet_ods::xmltree
source · Expand description
Defines an XML-Tree. This is used for parts of the spreadsheet that are not destructured in detail, but simply passed through. With a little bit of luck there is still some meaning left after modifying the rest.
use spreadsheet_ods::xmltree::XmlTag;
let tag = XmlTag::new("table:shapes")
.tag(XmlTag::new("draw:frame")
.attr("draw:z", "0")
.attr("draw:name", "Bild 1")
.attr("draw:style:name", "gr1")
.attr("draw:text-style-name", "P1")
.attr("svg:width", "10.198cm")
.attr("svg:height", "1.75cm")
.attr("svg:x", "0cm")
.attr("svg:y", "0cm")
.tag(XmlTag::new("draw:image")
.attr_slice([
("xlink:href", "Pictures/10000000000011D7000003105281DD09B0E0B8D4.jpg"),
("xlink:type", "simple"),
("xlink:show", "embed"),
("xlink:actuate", "onLoad"),
("loext:mime-type", "image/jpeg"),
])
.tag(XmlTag::new("text:p")
.text("sometext")
)
)
);
// or
let mut tag = XmlTag::new("table:shapes");
tag.set_attr("draw:z", "0".to_string());
tag.set_attr("draw:name", "Bild 1".to_string());
tag.set_attr("draw:style:name", "gr1".to_string());
let mut tag2 = XmlTag::new("draw:image");
tag2.set_attr("xlink:type", "simple".to_string());
tag2.set_attr("xlink:show", "embed".to_string());
tag2.add_text("some text");
tag.add_tag(tag2);
Structs§
- Defines a XML tag and it’s children.
Enums§
- A XmlTag can contain any mixture of XmlTags and text content.
Traits§
- Functionality for vectors of XmlTag’s.