[][src]Module sxd_document::writer

Formats a DOM structure to a Write

Example

use sxd_document::Package;
use sxd_document::writer::format_document;

let package = Package::new();
let doc = package.as_document();

let hello = doc.create_element("hello");
hello.set_attribute_value("planet", "Earth");
doc.root().append_child(hello);

let mut output = Vec::new();
format_document(&doc, &mut output).expect("unable to output XML");

Potential options to support

  • Space before />
  • Single vs double quotes
  • Fixed ordering of attributes

Structs

Writer

Write a document, specifying some formatting options

Functions

format_document

Formats a document into a Write using the default Writer