1 ! Copyright (C) 2005, 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup io strings ;
8 ARTICLE: "xml.writer" "Writing XML"
9 "These words are used in implementing prettyprint"
10 { $subsection write-xml-chunk }
11 "These words are used to print XML normally"
12 { $subsection xml>string }
13 { $subsection write-xml }
14 "These words are used to prettyprint XML"
15 { $subsection pprint-xml>string }
16 { $subsection pprint-xml>string-but }
17 { $subsection pprint-xml }
18 { $subsection pprint-xml-but } ;
21 { $values { "object" "an XML element" } }
22 { $description "writes an XML element to " { $link output-stream } "." }
23 { $see-also write-xml-chunk write-xml } ;
26 { $values { "xml" "an xml document" } { "string" "a string" } }
27 { $description "converts an XML document into a string" }
28 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
30 HELP: pprint-xml>string
31 { $values { "xml" "an xml document" } { "string" "a string" } }
32 { $description "converts an XML document into a string in a prettyprinted form." }
33 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
36 { $values { "xml" "an XML document" } }
37 { $description "prints the contents of an XML document to " { $link output-stream } "." }
38 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
41 { $values { "xml" "an XML document" } }
42 { $description "prints the contents of an XML document to " { $link output-stream } " in a prettyprinted form." }
43 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
46 { $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } }
47 { $description "Prettyprints an XML document, leaving the whitespace of the tags with names in sensitive-tags intact." }
48 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
50 HELP: pprint-xml>string-but
51 { $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } { "string" string } }
52 { $description "Prettyprints an XML document, returning the result as a string and leaving the whitespace of the tags with names in sensitive-tags intact." }
53 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
55 { xml>string write-xml pprint-xml pprint-xml>string pprint-xml>string-but pprint-xml-but } related-words