úÎIıB˜U      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.seNonePTake 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 Utable of escape characters character to escape escaped character U Haskell 98 experimental(Niklas Broberg, niklas.broberg@gmail.comNone The XMLMetaData datatype FSpecify the DOCTYPE, content-type, and preferred render for XML data.  See also:  and  .(show doctype when rendering, DOCTYPE string) @The XML datatype representation. Is either an Element or CDATA. Represents an attribue value. (Create an attribue value from a string. (Create an attribue value from a string. 1Test whether an XML value is an Element or CDATA 1Test whether an XML value is an Element or CDATA &Embeds a string as a CDATA XML value. &Embeds a string as a CDATA XML value. Pretty-prints XML values. VWXY Z[\    VYXW  Z[\ Haskell 98 experimental(Niklas Broberg, niklas.broberg@gmail.comNonePretty-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 ] / 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 ^_`abc^`_abc0requires newtype deriving and MPTCs with fundeps experimental*Niklas Broberg, niklas.broberg@chalmers.seNone*HNames can be simple or qualified with a domain. We want to conveniently ? use both simple strings or pairs wherever a Name is expected. /Set attributes on XML elements 38Similarly embed values as attributes of an XML element. 7MEmbed values as child nodes of an XML element. The parent type will be clear * from the context so it is not mentioned. >=Type synonyms to avoid writing out the XMLnGenT all the time ?0Generate XML values in some XMLGenerator monad. HBThe monad transformer that allows a monad to generate XML values. J un-lift. Kmap the inner monad dNPairs of strings can represent names, meaning a name qualified with a domain. eCStrings can represent names, meaning a simple name with no domain. fNPairs of strings can represent names, meaning a name qualified with a domain. gCStrings can represent names, meaning a simple name with no domain. h&Names can represent names, of course. M !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQijklmndefghopqrstuvwxyz{|4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ4HIJKG?@ABCDEF>=<;:97856342/01MLN,-.POQ*+()&'$%"# !7 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQijklmndefghopqrstuvwxyz{|NoneRST}~€‚ƒ„…†‡ˆ‰Š‹ŒRSTRSTRST}~€‚ƒ„…†‡ˆ‰Š‹Œ‘       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWWXYZ[\]^_`abcZ\]^defghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ‘’“ hsp-0.8.0HSP.XML.PCDATAHSP.XML HSP.HTML4HSP.XMLGenerator HSP.Monad setMetaData withMetaDataescapeescaperxmlEscapeChars XMLMetaDatadoctype contentTypepreferredRendererChildrenXMLCDATAElement Attributes AttrValueValue AttributeMkAttrNameDomainattrValpAttrVal isElementisCDATAcdatapcdata renderXMLhtmlEscapeChars renderAsHTML html4Stricthtml4StrictFrag TypeCastM'' typeCastM'' TypeCastM' typeCastM' TypeCastM typeCastM TypeCast'' typeCast'' TypeCast' typeCast'TypeCasttypeCastIsNametoName AppendChildappChildappAllSetAttrsetAttrsetAll XMLGenerator EmbedAsAttrasAttrAttr:= EmbedAsChildasChildGenAttributeList GenAttribute GenChildListGenChild GenXMLListGenXMLXMLGenXMLType ChildType AttributeType genElement genEElement xmlToChild pcdataToChildXMLGenT unXMLGenT mapXMLGenTset<@<<@app<:<<:HSPTunHSPTpCharTagTypeSingleCloseOpen renderTag renderXML'$fShowAttrValuebaseGHC.Errerror renderElement renderAsHTML' $fIsName(,) $fIsNameText $fIsName(,)0 $fIsName[] $fIsName(,)1$fTypeCastM''()mama$fTypeCastM'tmamb$fTypeCastMmamb$fTypeCast''()aa$fTypeCast'tab $fTypeCastab$fAppendChildmXMLGenT$fSetAttrmXMLGenT$fEmbedAsAttrm[]$fEmbedAsAttrmAttributeType$fEmbedAsAttrmAttr$fEmbedAsAttrmXMLGenT$fEmbedAsChildm()$fEmbedAsChildmText$fEmbedAsChildm[]$fEmbedAsChildmx$fEmbedAsChildmChildType$fEmbedAsChildm[]0$fEmbedAsChildmXMLGenT$fMonadTransXMLGenT$fXMLGeneratorHSPT$fEmbedAsAttrHSPTAttr$fEmbedAsAttrHSPTAttr0$fEmbedAsAttrHSPTAttr1$fEmbedAsAttrHSPTAttribute$fEmbedAsAttrHSPTAttr2$fEmbedAsChildHSPT()$fEmbedAsChildHSPTChar$fEmbedAsChildHSPTText$fEmbedAsChildHSPT[]$fEmbedAsChildHSPT[]0$fEmbedAsChildHSPTXML$fAppendChildHSPTXML$fSetAttrHSPTXML $fXMLGenHSPT$fMonadTransHSPTHSPChild unHSPChildHSPAttr unHSPAttr