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 { $subsection print-xml }
15 "These words are used to prettyprint XML"
16 { $subsection pprint-xml>string }
17 { $subsection pprint-xml>string-but }
18 { $subsection pprint-xml }
19 { $subsection pprint-xml-but } ;
22 { $values { "object" "an XML element" } }
23 { $description "writes an XML element to " { $link output-stream } "." }
24 { $see-also write-xml-chunk write-xml } ;
27 { $values { "xml" "an xml document" } { "string" "a string" } }
28 { $description "converts an XML document into a string" }
29 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
31 HELP: pprint-xml>string
32 { $values { "xml" "an xml document" } { "string" "a string" } }
33 { $description "converts an XML document into a string in a prettyprinted form." }
34 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
37 { $values { "xml" "an XML document" } }
38 { $description "prints the contents of an XML document to " { $link output-stream } "." }
39 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
42 { $values { "xml" "an XML document" } }
43 { $description "prints the contents of an XML document to " { $link output-stream } ", followed by a newline" }
44 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
47 { $values { "xml" "an XML document" } }
48 { $description "prints the contents of an XML document to " { $link output-stream } " in a prettyprinted form." }
49 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
52 { $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } }
53 { $description "Prettyprints an XML document, leaving the whitespace of the tags with names in sensitive-tags intact." }
54 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
56 HELP: pprint-xml>string-but
57 { $values { "xml" "an XML document" } { "sensitive-tags" "a sequence of names" } { "string" string } }
58 { $description "Prettyprints an XML document, returning the result as a string and leaving the whitespace of the tags with names in sensitive-tags intact." }
59 { $notes "does not preserve what type of quotes were used or what data was omitted from version declaration" } ;
61 { xml>string print-xml write-xml pprint-xml pprint-xml>string pprint-xml>string-but pprint-xml-but } related-words