hxt-9.1.2: A collection of tools for processing XML with Haskell.

Portability | portable
Stability | experimental
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)

Text.XML.HXT.Arrow.DocumentInput

Description

State arrows for document input

Synopsis

- getURIContents :: IOStateArrow s XmlTree XmlTree
- getXmlContents :: IOStateArrow s XmlTree XmlTree
- getXmlEntityContents :: IOStateArrow s XmlTree XmlTree
- getEncoding :: IOStateArrow s XmlTree String
- getTextEncoding :: IOStateArrow s XmlTree String
- decodeDocument :: IOStateArrow s XmlTree XmlTree
- addInputError :: Attributes -> String -> IOStateArrow s XmlTree XmlTree

# Documentation

getURIContents :: IOStateArrow s XmlTree XmlTree

getXmlContents :: IOStateArrow s XmlTree XmlTree

Read the content of a document.

This routine is usually called from `Text.XML.HXT.Arrow.ProcessDocument.getDocumentContents`.

The input must be a root node (constructed with `root`), usually without children. The attribute list contains all input parameters, e.g. URI or source file name, encoding preferences, ... If the source name is empty, the input is read from standard input.

The source is transformed into an absolute URI. If the source is a relative URI, or a file name, it is expanded into an absolut URI with respect to the current base URI. The default base URI is of protocol "file" and points to the current working directory.

The currently supported protocols are "http", "file", "stdin" and "string".

The latter two are internal protocols. An uri of the form "stdin:" stands for the content of the standard input stream.

"string:some text" means, that "some text" is taken as input. This internal protocol is used for reading from normal `String` values.

getXmlEntityContents :: IOStateArrow s XmlTree XmlTree

getEncoding :: IOStateArrow s XmlTree String

getTextEncoding :: IOStateArrow s XmlTree String

decodeDocument :: IOStateArrow s XmlTree XmlTree

addInputError :: Attributes -> String -> IOStateArrow s XmlTree XmlTree