QJ"W      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV 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 Wtable of escape characters character to escape escaped character W 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. &Embeds a string as a CDATA XML value. &Embeds a string as a CDATA XML value. 1Test whether an XML value is an Element or CDATA 1Test whether an XML value is an Element or CDATA Pretty-prints XML values. XYZ[ \]^    X[ZY  \]^ 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 `abcde`bacdeBrequires newtype deriving and MPTCs with fundeps and type families experimental)Niklas Broberg <niklas.broberg@gmail.com>None+HNames can be simple or qualified with a domain. We want to conveniently - use both simple strings or pairs wherever a I is expected. 0Set attributes on XML elements 48Similarly embed values as attributes of an XML element. 8MEmbed 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. JBThe monad transformer that allows a monad to generate XML values. L un-lift. Mmap the inner monad Nprepend attr# to the list of attributes for the elem Oprepend attr# to the list of attributes for the elem Pprepend the list of attr to the attributes for the elem Q append child to the children of elem R append child to the children of elem S#append children to the children of elem fNPairs of strings can represent names, meaning a name qualified with a domain. gCStrings can represent names, meaning a simple name with no domain. hNPairs of strings can represent names, meaning a name qualified with a domain. i&Names can represent names, of course. jCStrings can represent names, meaning a simple name with no domain. kCStrings can represent names, meaning a simple name with no domain. M !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSlmnopqfghijkrstuvwxyz{|}5 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS5JKLMI@ABCDEFGH?>=<;:8967453012ONP-./RQS+,)*'(%&#$!" 6 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSlmnopqfghijkrstuvwxyz{|}NoneTUV~TUVTUVTUV~NoneM  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRRSTUVWXYZ[[\]^_`abcdefg^`abhijklmnopqrstuvwxyz{|}~ hsp-0.9.2HSP.XML.PCDATAHSP.XML HSP.HTML4HSP.XMLGenerator HSP.Monad setMetaData withMetaDataHSPescapeescaperxmlEscapeChars XMLMetaDatadoctype contentTypepreferredRendererChildrenXMLCDATAElement Attributes AttrValueValue AttributeMkAttrNSName Namespace fromStringLitattrValpAttrValcdatapcdata isElementisCDATA renderXMLhtmlEscapeChars renderAsHTML html4Stricthtml4StrictFrag TypeCastM'' typeCastM'' TypeCastM' typeCastM' TypeCastM typeCastM TypeCast'' typeCast'' TypeCast' typeCast'TypeCasttypeCastIsNametoName AppendChildappChildappAllSetAttrsetAttrsetAll XMLGenerator EmbedAsAttrasAttrAttr:= EmbedAsChildasChildGenAttributeList GenAttribute GenChildListGenChild GenXMLListGenXMLXMLGenXMLType StringType ChildType AttributeType genElement genEElement xmlToChild pcdataToChildNameXMLGenT unXMLGenT mapXMLGenTset<@<<@app<:<<:HSPTunHSPTpCharTagTypeSingleCloseOpen renderTag renderXML'$fShowAttrValuebaseGHC.Errerror renderElement renderAsHTML'$fIsName(,)Text$fIsNameTextText$fIsName(,)Text0 $fIsName(,)a$fIsName[]Text $fIsName[][]$fTypeCastM''()mama$fTypeCastM'tmamb$fTypeCastMmamb$fTypeCast''()aa$fTypeCast'tab $fTypeCastab$fAppendChildmXMLGenT$fSetAttrmXMLGenT$fEmbedAsAttrm[]$fEmbedAsAttrmAttributeType$fEmbedAsAttrmAttr$fEmbedAsAttrmXMLGenT$fEmbedAsChildm()$fEmbedAsChildmx$fEmbedAsChildmChildType$fEmbedAsChildm[]$fEmbedAsChildmXMLGenT$fMonadTransXMLGenT$fXMLGeneratorHSPT$fEmbedAsAttrHSPTAttr$fEmbedAsAttrHSPTAttr0$fEmbedAsAttrHSPTAttr1$fEmbedAsAttrHSPTAttr2$fEmbedAsAttrHSPTAttribute$fEmbedAsChildHSPT()$fEmbedAsChildHSPTChar$fEmbedAsChildHSPTText$fEmbedAsChildHSPT[]$fEmbedAsChildHSPT[]0$fEmbedAsChildHSPTXML$fAppendChildHSPTXML$fSetAttrHSPTXML $fXMLGenHSPT$fMonadTransHSPTHSPChild unHSPChildHSPAttr unHSPAttr