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

Portabilityportable
Stabilitystable
MaintainerUwe Schmidt (uwe@fh-wedel.de)
Safe HaskellNone

Text.XML.HXT.Arrow.XmlState.URIHandling

Description

the basic state arrows for URI handling

Synopsis

Documentation

setBaseURI :: IOStateArrow s String StringSource

set the base URI of a document, used e.g. for reading includes, e.g. external entities, the input must be an absolute URI

getBaseURI :: IOStateArrow s b StringSource

read the base URI from the globale state

changeBaseURI :: IOStateArrow s String StringSource

change the base URI with a possibly relative URI, can be used for evaluating the xml:base attribute. Returns the new absolute base URI. Fails, if input is not parsable with parseURIReference

see also: setBaseURI, mkAbsURI

setDefaultBaseURI :: String -> IOStateArrow s b StringSource

set the default base URI, if parameter is null, the system base ( file:///<cwd>/ ) is used, else the parameter, must be called before any document is read

getDefaultBaseURI :: IOStateArrow s b StringSource

get the default base URI

runInLocalURIContext :: IOStateArrow s b c -> IOStateArrow s b cSource

remember base uri, run an arrow and restore the base URI, used with external entity substitution

parseURIReference' :: String -> Maybe URISource

parse a URI reference, in case of a failure, try to escape unescaped chars, convert backslashes to slashes for windows paths, and try parsing again

expandURIString :: String -> String -> Maybe StringSource

compute the absolut URI for a given URI and a base URI

expandURI :: ArrowXml a => a (String, String) StringSource

arrow variant of expandURIString, fails if expandURIString returns Nothing

mkAbsURI :: IOStateArrow s String StringSource

arrow for expanding an input URI into an absolute URI using global base URI, fails if input is not a legal URI

getSchemeFromURI :: ArrowList a => a String StringSource

arrow for selecting the scheme (protocol) of the URI, fails if input is not a legal URI.

See Network.URI for URI components

getRegNameFromURI :: ArrowList a => a String StringSource

arrow for selecting the registered name (host) of the URI, fails if input is not a legal URI

getPortFromURI :: ArrowList a => a String StringSource

arrow for selecting the port number of the URI without leading ':', fails if input is not a legal URI

getUserInfoFromURI :: ArrowList a => a String StringSource

arrow for selecting the user info of the URI without trailing '@', fails if input is not a legal URI

getPathFromURI :: ArrowList a => a String StringSource

arrow for computing the path component of an URI, fails if input is not a legal URI

getQueryFromURI :: ArrowList a => a String StringSource

arrow for computing the query component of an URI, fails if input is not a legal URI

getFragmentFromURI :: ArrowList a => a String StringSource

arrow for computing the fragment component of an URI, fails if input is not a legal URI

getPartFromURI :: ArrowList a => (URI -> String) -> a String StringSource

arrow for computing the path component of an URI, fails if input is not a legal URI