hxt-filter-8.4.2: A collection of tools for processing XML with Haskell (Filter variant).

Text.XML.HXT.Parser.XmlInput

Synopsis

Documentation

getXmlContents :: XmlStateFilter aSource

filter for reading the content of a XML document

input is a root node with the source as an attibute the text is read, the encoding scheme is parsed and selected and the input is translated into the internal UTF-8 string representation

getXmlEntityContents :: XmlStateFilter aSource

filter for reading the content of an external XML entity

see also : getXmlContents

getUrlContents :: XmlStateFilter aSource

the hard io operations

for reading a file or accessing a document via http input must be a root node with a source attribute specifying the URI

getContentLength :: XmlFilterSource

compute the length of the data for a document read previously by a call of 'getUrlContents. The result is stored as an attribute value in the document root node. the attribute name is a_contentLength

guessDocEncoding :: XmlStateFilter aSource

guessEncoding uses encoding attribute and content to determine the encoding scheme.

it's assumed that an encoding spec has been tried to parse before guessing the encoding.

UTF-8 is the default encoding

other supported encodings are ISO-8859-1 (also known as ISO-Latin-1), US-ASCII, UTF-16 or ISO-10646-UCS-2, UTF-16BE, UTF-16LE

runInLocalURIContext :: XmlStateFilter a -> XmlStateFilter aSource

filter command for saving and restoring the base URI

  • 1.parameter f : the filter that possible changes the base URI
  • returns : a filter with the same effect as f, that restores the base URI after application of f

runInNewURIContext :: String -> XmlStateFilter a -> XmlStateFilter aSource

filter command for running an action in a new URI context

getBaseURI :: XState state StringSource

read the current base URI

see also : setBaseURI

setBaseURI :: String -> XState state ()Source

set the base URI, all other URIs are handled relative to this base URI

the default base URI is file:///<current-working-dir>/

see also : getBaseURI

getAbsolutURI :: String -> XState state StringSource

transform an URI into an absolut URI using the current base URI

  • 1.parameter uri : the URI as string
  • returns : the absolut URI as string or "" in case of an error

isStandaloneDocument :: XState state BoolSource

predicate for testing the standalone document attribute