| ||||||||
| ||||||||
Description | ||||||||
Compound arrow for writing XML documents | ||||||||
Synopsis | ||||||||
| ||||||||
Documentation | ||||||||
| ||||||||
the main filter for writing documents this filter can be configured by an option list like Text.XML.HXT.Arrow.ReadDocument.readDocument usage: writeDocument optionList destination if destination is the empty string or "-", stdout is used as output device available options are
a minimal main program for copying a document has the following structure: module Main where import Text.XML.HXT.Arrow main :: IO () main = do runX ( readDocument [] "hello.xml" >>> writeDocument [] "bye.xml" ) return () an example for copying a document to standard output with tracing and evaluation of error code is: module Main where import Text.XML.HXT.Arrow import System.Exit main :: IO () main = do [rc] <- runX ( readDocument [ (a_trace, "1") ] "hello.xml" >>> writeDocument [ (a_output_encoding, isoLatin1) ] "-" -- output to stdout >>> getErrStatus ) exitWith ( if rc >= c_err then ExitFailure 1 else ExitSuccess ) | ||||||||
| ||||||||
Convert a document into a string. Formating is done the same way and with the same options as in writeDocument. Default output encoding is no encoding, that means the result is a normal unicode encode haskell string. The default may be overwritten with the Text.XML.HXT.XmlKeywords.a_output_encoding option. The XML PI can be suppressed by the Text.XML.HXT.XmlKeywords.a_no_xml_pi option. This arrow fails, when the encoding scheme is not supported. The arrow is pure, it does not run in the IO monad. The XML PI is suppressed, if not explicitly turned on with an option (a_no_xml_pi, v_0) | ||||||||
| ||||||||
indent and format output | ||||||||
Produced by Haddock version 2.4.2 |