XML property list parser and serializer.
Reads and writes Apple's XML plist format as defined by the
plist-1.0.dtd DOCTYPE. Output is accepted by plutil -lint and
round-trips correctly through plutil -convert xml1.
Quick start
use ;
let original = Dictionary;
// Serialize to XML bytes.
let mut buf = Vecnew;
write.unwrap;
let xml = from_utf8.unwrap;
assert!;
// Parse back.
let parsed = parse.unwrap;
assert_eq!;
Supported types
All [Value] variants except [Value::Null], [Value::Uid], and
[Value::Set] are supported. Attempting to serialize those returns
[WriteError::UnsupportedType].
Encoding details
- Strings are XML-escaped (
&,<,>,",'). - Data is base64-encoded (STANDARD alphabet), wrapped at 68 characters per line following Apple's convention.
- Dates are formatted as
YYYY-MM-DDTHH:MM:SSZ(ISO 8601 UTC), stored internally as seconds since the Apple epoch (2001-01-01 UTC). - Indentation uses tabs, matching
plutiloutput.