`3Wa      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` .needs dynamic exceptions and deriving Typeable experimental$Niklas Broberg, nibro@cs.chalmers.seab1User tried to do an irrefutable parameter lookup  that failed.  | ... I'*m sure there should be more exceptions, we'!ll add them when we get to them. cabcabbc Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.se MA record representing an interface to an HTTP request. This allows us to use N many different underlying types for these requests, all we need is to supply O conversions to this interface. This is useful for when we run as CGI, or when  we run inside a server app.  DGet a parameter from the request query string (GET) or body (POST).  | Returns Nothing if the parameter is not set. QUnsafe version of getParameter, essentially fromJust.(getParameter r) but throws @ a ParameterLookupFailed exception if the parameter is not set. $Return a value instead of a string. @Return a list of values read from their string representations.  Unsafe version of readParameter    'The runtime environment for HSP pages.   Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.sePTake a normal string and transform it to PCDATA by escaping special characters.  calls  with   See also:  PTake a normal string and transform it to PCDATA by escaping special characters.  See also: ,  table of escape characters String to escape Escaped String dtable of escape characters character to escape escaped character NTake a PCDATA string and translate all escaped characters in it to the normal  characters they represent. Q Does no error checking of input string, will fail if input is not valid PCDATA.  calls  with   See also:  NTake a PCDATA string and translate all escaped characters in it to the normal  characters they represent. Q Does no error checking of input string, will fail if input is not valid PCDATA.  See also: ,  table of escape characters String to unescape unescaped String  Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.seefghRepresents an attribue value. The XMLMetaData datatype FSpecify the DOCTYPE, content-type, and preferred render for XML data.  See also: HSP.Monad.setMetaData and HSP.Monad.withMetaData .(show doctype when rendering, DOCTYPE string)  !@The XML datatype representation. Is either an Element or CDATA. "#$%&'()1Test whether an XML value is an Element or CDATA *+&Embeds a string as a CDATA XML value. ,-(Create an attribue value from a string. .Pretty-prints XML values. ij !"#$%&'()*+,-.!#" '&%$+*,-.()  !#""#$%&'()*+,-. Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.se klm/Pretty-prints HTML values. Error Handling: CSome tags (such as img) can not contain children in HTML. However, ? there is nothing to stop the caller from passing in XML which B contains an img tag with children. There are three basic ways to  handle this:  " drop the bogus children silently  call n / raise an exception ? render the img tag with children -- even though it is invalid !Currently we are taking approach #3, since no other attempts to C validate the data are made in this function. Instead, you can run @ the output through a full HTML validator to detect the errors. #C1 seems like a poor choice, since it makes is easy to overlook the  fact that data went missing. ?We could raising errors, but you have to be in the IO monad to E catch them. Also, you have to use evaluate if you want to check for A errors. This means you can not start sending the page until the D whole page has been rendered. And you have to store the whole page < in RAM at once. Similar problems occur if we return Either C instead. We mostly care about catching errors and showing them in B the browser during testing, so perhaps this can be configurable. @Another solution would be a compile time error if an empty-only  tag contained children. .FIXME: also verify that the domain is correct 0FIXME: what to do if a namespace is encountered opq012/012/012/012 Grequires undecidable and overlapping instances, and forall in datatypes experimental$Niklas Broberg, nibro@cs.chalmers.se345)The HSP monad is a reader wrapper around : the IO monad, but extended with an XMLGenerator wrapper. type HSP' = ReaderT HSPEnv IO type HSP = XMLGenT HSP' r6RRuns a HSP computation in a particular environment. Since HSP wraps the IO monad, 5 the result of running it will be an IO computation. 789sVRuns a HSP computation without an environment. Will work if the page in question does R not touch the environment. Not sure about the usefulness at this stage though... :0Execute an IO computation within the HSP monad. ;<=Supplies the HSP environment. t>?@Catch a user-caused exception. 3456789s:;<=>?@3456789s:;<=>?@ uvABCwxyz{|1}~ABCABBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`EFGDHIJKMNOPQRSTUVWXYZ[\]^_`LDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`}~  !"#$%'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`5346978=>?:@;<ABC   !"#$%&''()*+,-./0123456789:;< = >  ? @ A B C D E F G H I J K LMNOPQRSTUVWXYZ[\]^_`abcdefghi j k lmnopqrsnpqtuvwxs y z { | } ~      0                   hsp-0.5.1HSPHSP.Env.NumberGenHSP.Env.RequestHSP.EnvHSP.XML.PCDATAHSP.XMLHSP.HTML HSP.HJScript HSP.Exception HSP.MonadHSP.XMLGenerator hsx-0.7.0HSX.XMLGenerator genElement genEElement NumberGen incNumberRequest getParameterL getHeaders getParameter getParameter_ readParameterreadParameterLreadParameter_HSPEnvgetReqgetNG mkSimpleEnvescapeescaperxmlEscapeCharsunescape unescaper AttrValueValue AttributeMkAttr XMLMetaDatadoctype contentTypepreferredRendererXMLCDATAElementChildren AttributesNameDomain isElementisCDATAcdatapcdataattrValpAttrVal renderXML renderAsHTMLhtmlEscapeChars html4Stricthtml4StrictFragHSPTHSPT'runHSPrunHSPTevalHSPTevalHSPdoIO setMetaData withMetaDatagetEnvgetParam getIncNumbercatch IsAttrValue toAttrValueextractElemRef newGlobalVarnewGlobalVarWithnewGlobVarNamegenIdrefsetIdonEventonAbortonBluronChangeonClick onDblClickonErroronFocus onKeyDown onKeyPressonKeyUponLoad onMouseDown onMouseMove onMouseOut onMouseOver onMouseUponResetonResizeonSelectonSubmitonUnload ExceptionParameterLookupFailedthrowHSPpCharTagTypeSingleCloseOpen renderXML' renderTagbaseGHC.Errerror renderAsHTML' renderElementdummyEnv unsafeRunHSP getRequest GetAttrValue fromAttrValueelement stripAttr stripChildeAttrsinserteElementAttr:=asAttrasChild<<:<:app<<@<@set mapXMLGenT unXMLGenTXMLGenTGenXML GenXMLListGenChild GenChildList GenAttributeGenAttributeList EmbedAsChild EmbedAsAttr XMLGeneratorsetAllsetAttrSetAttrappAllappChild AppendChildtoNameIsNametypeCastTypeCast typeCast' TypeCast' typeCast'' TypeCast'' typeCastM TypeCastM typeCastM' TypeCastM' typeCastM'' TypeCastM''