M[R      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . /0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     GFirst argument is a transformer for pattern strings, e.g. map toLower, E but only applying to parts of the pattern not in quotation marks. E (Needed to canonicalise HTML where tags are case-insensitive, but ) attribute values are case sensitive.) CThe symbol table stored in a document holds all its general entity  reference definitions.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~|}z{tuvwxy~rsmnopqijkldefghabc_`]^YZ[\QRSTUVWXNOPMLHIJKFGCDEBA?@=>:;<9874562301-./*+,'()%&#$!"   portable experimentalsimons@cryp.to&This class promises that the function  knows how to : format this data type into a string without changing the  formatting. ?This is a helper function is required because Haskell does not ' allow to make an ordinary tuple (like y) an instance of a D class. The resulting output will preface the actual attribute with ! a single blank so that lists of ys can be handled + implicitly by the definition for lists of  data types. CA concrete representation of any user-defined Haskell constructor. G The constructor has a name, and a sequence of component types. The C first sequence of types represents the minimum set of free type E variables occurring in the (second) list of real component types. F If there are fieldnames, they are contained in the final list, and 3 correspond one-to-one with the component types. /A concrete representation of any Haskell type.  HTypeable; promises that we can create an explicit representation of  of the type of any value.  Project the n'8th constructor from an HType and convert it to a string  suitable for an XML tagname. ; converts a concrete representation of the Haskell type of # a value (obtained by the method ) into a real DocTypeDecl. H It ensures that PERefs are defined before they are used, and that no 9 element or attribute-list is declared more than once. :Source positions contain a filename, line, column, and an = inclusion point, which is itself another source position,  recursively. BDummy value for generated data, where a true source position does  not exist. posInNewCxt name pos0 creates a new source position from an old one. H It is used when opening a new file (e.g. a DTD inclusion), to denote  the start of the file name*, but retain the stacked information that  it was included from the old pos. CJust used to strictify the internal values of a position, to avoid  space leaks. 1Add n character positions to the given position. ,Add a newline or tab to the given position. 5Add the given whitespace char to the given position.  Precondition: white c | isSpace c = True The basic token type. 1All tokens are paired up with a source position. / Lexical errors are passed back as a special TokenT value. The first argument to - is the filename (used for source positions, J especially in error messages), and the second is the string content of  the XML file. 9 is used when the parser expands a macro (PE reference). J The expansion of the macro must be re-lexed as if for the first time. / is used solely within parsing an entityvalue. E Normally, a PERef is logically separated from its surroundings by D whitespace. But in an entityvalue, a PERef can be juxtaposed to ; an identifier, so the expansion forms a new identifier. ? Thus the need to rescan the whole text for possible PERefs. // :XParser is just a specialisation of the PolyState parser. To parse a whole document, xmlParse file content takes a filename G (for generating error reports) and the string content of that file. A A parse error causes program failure, with message to stderr. To parse just a DTD, dtdParse file content takes a filename A (for generating error reports) and the string content of that ' file. If no DTD was found, you get Nothing rather than an error. H However, if a DTD is found but contains errors, the program crashes. To parse a whole document, xmlParse' file content takes a filename G (for generating error reports) and the string content of that file. D Any parse error message is passed back to the caller through the  Either type. To parse just a DTD, dtdParse' file content takes a filename A (for generating error reports) and the string content of that ' file. If no DTD was found, you get  Right Nothing. 5 If a DTD was found but contains errors, you get a  Left message. ETo parse a partial document, e.g. from an XML-based stream protocol, H where you may later want to get more document elements from the same C stream. Arguments are: a parser for the item you want, and the C already-lexed input to parse from. Returns the item you wanted ; (or an error message), plus the remainder of the input. 3Some empty symbol tables for GE and PE references. IReturn the next token from the input only if it matches the given token. 7Return just a name, e.g. element name, attribute name. BReturn an entire XML document including prolog and trailing junk. Return an XML comment.  Parse a processing instruction. )Return a DOCTYPE decl, indicating a DTD. 5Return a DTD markup decl, e.g. ELEMENT, ATTLIST, etc ;Return a complete element including all its inner content. ?Parse only the parts between angle brackets in an element tag. HFor use with stream parsers - returns the complete opening element tag. AFor use with stream parsers - accepts a closing tag, provided it # matches the given element name. >Return a content particle, e.g. text, element, reference, etc  DReturn either a general entity reference, or a character reference.  4Return parsed freetext (i.e. until the next markup)       >XParser is just a specialisation of the PolyStateLazy parser.  To parse a whole document, xmlParse file content takes a filename G (for generating error reports) and the string content of that file. A A parse error causes program failure, with message to stderr. ETo parse a partial document, e.g. from an XML-based stream protocol, H where you may later want to get more document elements from the same C stream. Arguments are: a parser for the item you want, and the C already-lexed input to parse from. Returns the item you wanted ; (or an error message), plus the remainder of the input. 3Some empty symbol tables for GE and PE references. IReturn the next token from the input only if it matches the given token. 7Return just a name, e.g. element name, attribute name. BReturn an entire XML document including prolog and trailing junk. Return an XML comment.  Parse a processing instruction. )Return a DOCTYPE decl, indicating a DTD. 5Return a DTD markup decl, e.g. ELEMENT, ATTLIST, etc ;Return a complete element including all its inner content. ?Parse only the parts between angle brackets in an element tag. HFor use with stream parsers - returns the complete opening element tag. AFor use with stream parsers - accepts a closing tag, provided it # matches the given element name. >Return a content particle, e.g. text, element, reference, etc DReturn either a general entity reference, or a character reference. 4Return parsed freetext (i.e. until the next markup)        )saxParse file content1 takes a filename and the string content of that " file and generates a stream of  SaxElements. If an error occurs, the 4 parsing stops and a string is returned using the Maybe type.  !"#$%&'()  !"#$%&'() *+,-*+,- .EThe first argument is the name of the file, the second is the string F contents of the file. The result is the generic representation of N an XML document. Any errors cause program failure with message to stderr. ../EThe first argument is the name of the file, the second is the string F contents of the file. The result is the generic representation of N an XML document. Any errors cause program failure with message to stderr. EThe first argument is the name of the file, the second is the string F contents of the file. The result is the generic representation of < an XML document. Any parsing errors are returned in the Either type. //01234561324056F:Need to keep both the XML and Haskell versions of a name. Horiginal XML name Imangled Haskell name KPretty print Haskell name. LPretty print XML name. M&Pretty print Haskell attributes name. N0Make a type name valid in both XML and Haskell. O9Append an underscore to the Haskell version of the name. PFPrefix an attribute enumeration type name with its containing element  name. QGPrefix an attribute enumeration constructor with its element-tag name, " and its enumeration type name. R5Prefix a field name with its enclosing element name. S(Convert an XML name to a Haskell conid. GEnsure a generated name does not conflict with a standard haskell one. T(Convert an XML name to a Haskell varid. .Convert colon to prime, hyphen to underscore. 789:;<=>?@ABCDEFGHIJKLMNOPQRSTCDEBA789:;<=>?@JKLMFGHINOPQRSTU<Convert typedef to appropriate instance declaration, either  XmlContent,   XmlAttributes, or  XmlAttrType. UUVV(WFA LabelFilter is like a CFilter except that it pairs up a polymorphic + value (label) with each of its results. X+Conjoin the two branches of a conditional. Z!All document transformations are content filters.  A filter takes a single XML t value and returns a sequence  of t values, possibly empty. ]?Throw away current node, keep just the (unprocessed) children. ^ Select the n'"th positional result of a filter. e!For a mandatory attribute field,  find key cont looks up the value of  the attribute name key, and applies the continuation cont to  the value. f+When an attribute field may be absent, use iffind key yes no to lookup : its value. If the attribute is absent, it acts as the no filter,  otherwise it applies the yes filter. g ifTxt yes no( processes any textual content with the yes filter, $ but otherwise is the same as the no filter. h9Select between the two branches of a joined conditional. i Sequential (Irish, backwards) composition jDBinary parallel composition. Each filter uses a copy of the input, 7 rather than one filter using the result of the other. 0 (Has a more general type than just CFilter.) k<Glue a list of filters together. (A list version of union; 4 also has a more general type than just CFilter.) l=A special form of filter composition where the second filter < works over the same data as the first, but also uses the  first' s result. +Process children using specified filters.  not exported mDirectional choice:  in f |>| g- give g-productions only if no f-productions n Pruning: in f n g, F keep only those f-productions which have at least one g-production o Pruning: in f o g, = keep only those f-productions which have no g-productions p Pronounced slash, f /> g means g inside f q Pronounced outside, f </ g means f containing g r8Join an element-matching filter with a text-only filter s4Express a list of filters like an XPath query, e.g.  path [children, tag "name1", attr "attr1", children, tag "name2"]  is like the XPath query /name1[@attr1]/name2. wInterior editing:  f w g applies f only when the predicate g succeeds, ' otherwise the content is unchanged. xInterior editing:  g x f applies f only when the predicate g succeeds, ' otherwise the content is discarded. yBProcess CHildren In Place. The filter is applied to any children F of an element content, and the element rebuilt around the results. zCProcess an element In Place. The filter is applied to the element E itself, and then the original element rebuilt around the results. {ARecursive application of filters: a fold-like operator. Defined  as f i chip (foldXml f). |FBuild an element with the given tag name - its content is the results ! of the given list of filters. }?Build an element with the given name, attributes, and content. ~Build some textual content. Build some CDATA content. 5Rename an element tag (leaving attributes in place). =Replace the attributes of an element (leaving tag the same). BCompose a label-processing filter with a label-generating filter. =Combine labels. Think of this as a pair-wise zip on labels.  e.g.  (numbered  tagged) #Number the results from 1 upwards. In interspersed a f b, label each result of f with the string a, = except for the last one which is labelled with the string b. ALabel each element in the result with its tag name. Non-element & results get an empty string label. HLabel each element in the result with the value of the named attribute. C Elements without the attribute, and non-element results, get an  empty string label. >Label each textual part of the result with its text. Element & results get an empty string label. @Label each content with some information extracted from itself. 3WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~3Z[\]^_`acdbefgijklmnopqrstuvwxyz{|}~XYhW?This useful auxiliary checks the commandline arguments for two A filenames, the input and output file respectively. If either ! is missing, it is replaced by ", which can be interpreted by the  caller as stdin and/ or stdout.  The wrapper processXmlWith returns an IO () computation ( that collects the filenames (or stdin/stdout) to use when  reading/-writing XML documents. Its CFilter argument ? is applied to transform the XML document from the input and > write it to the output. No DTD is attached to the output. BIf the input filename ends with .html or .htm, it is parsed using G the error-correcting HTML parser rather than the strict XML parser.  =double content filter - takes document root + local subtree. 4lift an ordinary content filter to a double filter. 4drop a double filter to an ordinary content filter. 1 (permitting interior access to document root) 4drop a double filter to an ordinary content filter. B (Where interior access to the document root is not needed, the ? retaining pointer to the outer element can be pruned away.   is more space-efficient than  in this situation.) 2lift a CFilter combinator to a DFilter combinator (lifted composition over double filters. lifted choice. lifted union. lifted predicates. lifted unit and zero.  !"#$ITo convert an Xtract query into an ordinary HaXml combinator expression. I First arg is a tag-transformation function (e.g. map toLower) applied AThe cool thing is that the Xtract command parser directly builds  a higher-order  (see !Text.XML.HaXml.Xtract.Combinators) @ which can be applied to an XML document without further ado.  ( parseXtract/ halts the program if a parse error is found.) % parseXtract'1 returns error messages through the Either type. ';The List1 type represents lists with at least one element. C It is required for DTD content models that use + as a modifier. A type corresponding to XML's ANY contentspec. * It is either a list of unconverted xml t  or some  -able value. Parsing functions (e.g. ) will always produce .  Note: The Show instance for  uses . AIf an attribute is defaultable, then it either takes the default D value (which is omitted from the output), or a non-default value & (which obviously must be printed). The  XmlAttrType0 class promises that an attribute taking an XML A enumerated type can be converted to and from a Haskell value. The  XmlAttributes2 class promises that a list of XML tag attributes 1 can be converted to and from a Haskell value. The  XmlContent3 class promises that an XML Content element can be * converted to and from a Haskell value. Convert from XML to Haskell Convert from Haskell to XML 'Dummy functions (for most types): used only in the Char instance + for coercing lists of Char into String. FWe need a parsing monad for reading generic XML Content into specific K datatypes. This is a specialisation of the Text.ParserCombinators.Poly = ones, where the input token type is fixed as XML Content. Read a single attribute called value. Generate a single attribute. =Generate an element with no attributes, named for its HType. 8Generate an element with no attributes, named directly. $Turn a simple string into XML text. )Turn a string into an XML CDATA section. ! (i.e. special characters like &( are preserved without interpretation.) ARead an XML document from a file and convert it to a fully-typed  Haskell value. >Write a fully-typed Haskell value to the given file as an XML  document. >Write any Haskell value to the given file as an XML document, I using the FastPackedString interface (output will not be prettified). /Read a fully-typed XML document from a string. >Convert a fully-typed XML document to a string (without DTD). BConvert a fully-typed XML document to a ByteString (without DTD). FConvert a fully-typed XML document to a string (with or without DTD). @Read a Haskell value from an XML document, ignoring the DTD and ? using the Haskell result type to determine how to parse it. 4Read a fully-typed XML document from a file handle. 3Write a fully-typed XML document to a file handle. =Write a fully-typed XML document to a file handle, using the ? FastPackedString interface (output will not be prettified). DThe most primitive combinator for XMLParser - get one content item. GGet the next content element, checking that it has one of the required , tags, using the given matching function. ? (Skips over comments and whitespace, rejects text and refs. ' Also returns position of element.) A specialisation of posnElementWith (==). GGet the next content element, checking that it has one of the required G tags. (Skips over comments and whitespace, rejects text and refs.) FLike element, only permits a more flexible match against the tagname. GRun an XMLParser on the contents of the given element (i.e. not on the E current monadic content sequence), checking that the contents are G exhausted, before returning the calculated value within the current  parser context. %A combination of element + interior. )A combination of elementWith + interior. 7Do some parsing of the attributes of the given element  is a counterpart to , parsing text content if it 8 exists. Adjacent text and references are coalesced. ' choice f p'9 means if parseContents succeeds, apply f to the result, * otherwise use the continuation parser. not sure this is needed now. ' definite p' previously ensured that H an element was definitely present. Now I think the monad might take  care of that for us. u&'()*+,-./0123456789:;<=>?:;<tuvwxyz{|}M|}z{tuvwxy:;<@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               >Convert a fully-typed XML document to a string (without DTD). FConvert a fully-typed XML document to a string (with or without DTD). 9 takes a DTD and a tagged element, and returns a list of 3 errors in the document with respect to its DTD. @If you have several documents to validate against a single DTD, H then you will gain efficiency by freezing-in the DTD through partial  application, e.g. checkMyDTD = validate myDTD. 6 is like validate, except that it does not check that + the element type matches that of the DTD's root element. The version of the library.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/0123456WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()**++,-.//001234556789::;;<<=>?@ABCDEFGHHIIJKLMNOPQRSSTTUVWUVXXYZ[\]^_]^`abcdefgh_`ijjkklmnopqrstuvwxxlyz{{|}~$ &                       44!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~AEBG47>?CHIMT  F358LN      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ HaXml-1.19.4Text.XML.HaXml.Xtract.LexText.XML.HaXml.TypesText.XML.HaXml.VerbatimText.XML.HaXml.PrettyText.XML.HaXml.TypeMappingText.XML.HaXml.PosnText.XML.HaXml.UtilText.XML.HaXml.LexText.XML.HaXml.ParseText.XML.HaXml.ParseLazyText.XML.HaXml.SAXText.XML.HaXml.Html.PrettyText.XML.HaXml.Html.ParseLazyText.XML.HaXml.Html.ParseText.XML.HaXml.Escape#Text.XML.HaXml.DtdToHaskell.TypeDef$Text.XML.HaXml.DtdToHaskell.Instance#Text.XML.HaXml.DtdToHaskell.ConvertText.XML.HaXml.CombinatorsText.XML.HaXml.Html.GenerateText.XML.HaXml.Wrappers!Text.XML.HaXml.Xtract.CombinatorsText.XML.HaXml.Xtract.ParseText.XML.HaXml.ByteStringPPText.XML.HaXml.XmlContentText.XML.HaXml.OneOfNText.XML.HaXml.ShowXmlLazyText.XML.HaXml.ValidateText.XML.HaXmlbasePreludeTokenTTokNum TokStringSymbolPosnPnToken lexXtractCDSectCharData SystemLiteral PubidLiteralEVEVRefEVString EntityValueAttValueNmTokensNmTokenNamesName EncodingDeclPublicIDPUBLICID NotationDeclNOTATIONExtPE ExtParsedEntTextDecl NDataDeclNDATA ExternalIDPUBLICSYSTEMPEDefPEDefExternalIDPEDefEntityValue EntityDef DefExternalIDDefEntityValuePEDeclGEDecl EntityDecl EntityPEDecl EntityGEDecl PEReferenceCharRef EntityRef ReferenceRefChar RefEntityIgnoreSectContentsIgnore IgnoreSect IncludeSectConditionalSectFIXED DefaultDecl DefaultToIMPLIEDREQUIRED Enumeration NotationTypeEnumeratedType TokenizedTypeNMTOKENSNMTOKENENTITIESENTITYIDREFSIDREFIDAttType StringTypeAttDef AttListDeclMixed PCDATAplusPCDATAModifierPlusStarQueryNoneCPSeqChoiceTagName ContentSpecANYEMPTY ElementDeclContentCMiscCRefCStringCElem AttributeElemTagElementElem ExtSubsetDeclExtConditionalSect ExtMarkupDecl ExtSubset MarkupDecl MarkupMiscNotationEntityAttList DocTypeDeclDTDPITargetComment VersionInfoSDDeclProcessingInstructionMiscPIXMLDeclPrologDocumentSymTabemptySTaddSTlookupSTinfoVerbatimverbatimverbAttrdocumentprolog doctypedeclelementcontentcpConstrHTypeDefinedStringPrimTupleListMaybe HTypeabletoHType showConstrtoDTD showHType posnFilenameposnLine posnColumnnoPos posInNewCxtforcepaddcolnewlinetabwhite docContent contentElemattrstagTextContentSectionIGNORExINCLUDExCDATAxSpecial NOTATIONxENTITYxATTLISTxELEMENTxDOCTYPExTokErrorTokNull TokFreeTextTokNameTokQuoteTokComma TokPercentTokPipe TokBraClose TokBraOpenTokHashTokSemiTokAmpTokPlusTokStarTokQueryTokEqual TokSqClose TokSqOpen TokAnyClose TokAnyOpen TokEndClose TokEndOpen TokSpecialTokSpecialOpen TokSectionTokSectionCloseTokSectionOpen TokPIClose TokPIOpenTokCommentCloseTokCommentOpenxmlLexxmlReLexreLexEntityValueXParserxmlParsedtdParse xmlParse' dtdParse' xmlParseWithemptySTsfst3snd3thd3toknamecommentprocessinginstructioncdsectelemtag elemOpenTag elemCloseTag referencechardata SaxElement SaxReference SaxCharData SaxElementTagSaxElementCloseSaxElementOpen SaxCommentSaxProcessingInstructionSaxDocTypeDeclsaxParse attribute htmlParse XmlEscaper xmlEscapexmlEscapeContent xmlUnEscapexmlUnEscapeContent stdXmlEscaper mkXmlEscaper StructTypeAnyOneOfList1 Defaultable AttrFields ConstructorsTypeDefEnumDefDataDefxNamehName ppTypeDefppHNameppXNameppANamename_name_aname_acname_fmanglemanglef mkInstance dtd2TypeDef LabelFilterThenElse:>CFilterkeepnonechildrenpositionelmtxttagtagWithattrattrvalfindiffindifTxt?>ounioncatandThen|>|withwithout/>