5@ :      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab c d e f g h i j k l m n o p q r s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                             ! " # $ % & ' ( )!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~!!!!!!!!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""##$$$$$$$$$$$$$$$ $ $ $ $ $$$$$$$$$$$$$$$$$$$ $!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T&U&V&W&X&Y&Z'['\']'^'_'`'a'b'c'd'e(f)g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*{*|*}*~******************************+,-./0000000011111111111111111111111111111111112222222334444444444455566666666666667777777888899::;<=>??????@ A A A A BBBBBBBBBBBBCCCCCCC C!C"C#C$C%C&C'C(C)C*C+C,C-C.C/C0C1C2C3C4C5C6C7C8C9C:C;C<C=C>C?C@CACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZC[C\C]C^C_C`CaCbCcCdCeCfCgChCiCjCkClCmCnCoCpCqCrCsCtCuCvCwCxCyCzC{C|C}C~CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGHHH H H H H HHHHHHHHHHHHIIIIIII I!I"I#I$J%J&J'J(J)J*J+J,J-J.J/J0J1J2J3J4J5J6J7J8J9J:J;J<J=J>J?J@JAJBJCJDJEJFJGJHJIJJJKJLJMJNJOJPJQKRKSKTKUKVKWKXKYKZK[K\K]K^K_K`KaKbKcKdKeKfLgLhMiMjMkNlNmOnOoPpQqQrQsQtQuQvRwRxRyRzR{R|R}R~RRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTUUUUVVVVWWWWWWWWXXXYYYYYZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ Z Z Z Z ZZZZZZZZZZZZZZZZZZZ Z!Z"Z#Z$Z%Z&Z'Z(Z)Z*Z+Z,Z-Z.Z/Z0Z1Z2Z3Z4Z5Z6Z7Z8Z9Z:Z;Z<Z=Z>Z?Z@ZAZBZCZDZEZFZGZHZIZJZKZLZMZNZOZPZQZRZSZTZUZVZWZXZYZZZ[Z\Z]Z^Z_Z`ZaZbZcZdZeZfZgZhZiZjZkZlZmZnZoZpZqZrZsZtZuZvZwZxZyZzZ{Z|Z}Z~ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ[[[[[[[[[[[[[[[[[[[[[[[[[[[[\\\\\\\\\\\\]]]] ] ] ] ] ]]]]]]]]]]^^^^^^^^^ ^!^"^#^$^%^&^'^(^)^*^+^,^-^.^/^0^1^2^3^4^5^6^7^8^9^:^;^<^=^>_?^@^A^B^C^D^E`F`G`H`I`J`K`L`M`N`O`P`Q`R`S`T`U`V`W`X`Y`Z`[`\`]`^`_```a`b`c`d`e`f`g`h`i`j`k`l`m`n`o`p`q`r`s`t`u`v`w`x`y`z`{`|`}`~````````````````````````````aaaabbbbbbccddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefffffghiiiiijjjjjj j k k l llllllmmmmmmnnnnnnn n!n"n#n$n%n&n'o(o)o*o+o,o-o.p/p0p1p2p3p4p5p6p7p8p9q:q;q<q=q>q?q@qAqBqCqDqEqFqGqHqIqJqKqLqMqNqOqPqQqRqSqTqUqVqWqXqYqZq[q\q]q^q_q`qaqbqcqdrerfrgrhrirjrkrlsmsnsospsqsrssstsusvswsxsyszs{s|s}s~sssssssssssssssssssssstttuuvvvvwwwwwxx_________2Constructs a regular expression for an empty set. % 1.parameter errMsg : error message / returns : regular expression for an empty set 7Constructs a regular expression for an empty sequence. 4 returns : regular expression for an empty sequence 7Constructs a regular expression for accepting a symbol . 1.parameter sym : the symbol to be accepted 5 returns : regular expression for accepting a symbol @Constructs a regular expression for accepting any singel symbol > returns : regular expression for accepting any singel symbol >Constructs an optional repetition (*) of a regular expression 6 1.parameter re_a : regular expression to be repeted " returns : new regular expression remove redundant nested *'s in RE % theoretically this is unneccessary, G but without this simplification the runtime can increase exponentally L when computing deltas, e.g. for a** or (a|b*)* which is the same as (a|b)* 4Constructs a repetition (+) of a regular expression 6 1.parameter re_a : regular expression to be repeted " returns : new regular expression 1Constructs an option (?) of a regular expression 7 1.parameter re_a : regular expression to be optional " returns : new regular expression 5Constructs a sequence (,) of two regular expressions : 1.parameter re_a : first regular expression in sequence ; 2.parameter re_b : second regular expression in sequence " returns : new regular expression 9Constructs an alternative (|) of two regular expressions = 1.parameter re_a : first regular expression of alternative > 2.parameter re_b : second regular expression of alternative " returns : new regular expression ;Checks if a regular expression matches the empty sequence. nullable e == [] `in` L(e) HThis check indicates if a regular expression fits to a sentence or not. 4 1.parameter re : regular expression to be checked B returns : true if regular expression matches the empty sequence,  otherwise false 9Derives a regular expression with respect to one symbol. L(delta e x) = x  L(e) 4 1.parameter re : regular expression to be derived J 2.parameter sym : the symbol on which the regular expression is applied * returns : the derived regular expression 9Derives a regular expression with respect to a sentence. & 1.parameter re : regular expression F 2.parameter s : sentence to which the regular expression is applied * returns : the derived regular expression HChecks if an input matched a regular expression. The function should be  called after matches. Was the sentence used in matches, in the language of the regular expression?  -> matches e s == s `in` L(e)? 2 1.parameter re : the derived regular expression K returns : empty String if input matched the regular expression, otherwise , an error message is returned <Constructs a string representation of a regular expression. ( 1.parameter re : a regular expression ? returns : the string representation of the regular expression #Data type for regular expressions.    portable experimentalUwe Schmidt (uwe@fh-wedel.de)-enumerate all chars specified by a predicate ?this function is expensive, it should only be used for testing  !"#$%&'()*+,, !"#$%&'()*+portable experimentalUwe Schmidt (uwe@fh-wedel.de)$-./0123456789:;<=>?@ABCDEFGHIJKLMNOP$-./0123456789:;<=>?@ABCDEFGHIJKLMNOPportable experimentalUwe Schmidt (uwe@fh-wedel.de)QQRSTUVWXYZ[\]^_RSTUVWXYZ[\]^_`=list of predefined XML entity names and their unicode values ``aBtable with all XHTML entity refs and corresponding unicode values aa bcbc portable experimentalUwe Schmidt (uwe@fh-wedel.de)l&the predefined namespace uri for xml: "http:// www.w3.org/XML/1998/ namespaces" m(the predefined namespace uri for xmlns: "http:// www.w3.org/2000/xmlns/" nRelax NG namespace def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = > defghijklmno  none portable experimentalUwe Schmidt (uwe\@fh-wedel.de)p?call an external program with a list of command line arguments A and return content of stdout, content of stderr and return code pp qOremove leading and trailing whitespace with standard Haskell predicate isSpace rBconvert string to upercase with standard Haskell toUpper function sRemoves leading /( trailing whitespaces and leading zeros t3Reduce whitespace sequences to a single whitespace u'replace all whitespace chars by blanks v)Escape all disallowed characters in URI  references (see  )http://www.w3.org/TR/xlink/#link-locators) wescape XML chars &lt;, &gt;, &Equot;, and ampercent by transforming them into character references  see also : y  xescape XML chars &`lt; and ampercent by transforming them into character references, used for escaping text nodes  see also : y  yYescape XML chars in attribute values, same as stringEscapeXml, but none blank whitespace  is also escaped  see also : w  {3convert a string of hexadecimal digits into an Int |'convert a string of digits into an Int }Dconvert a string into a hexadecimal string applying charToHexString  see also : ~  ~8convert a char (byte) into a 2-digit hexadecimal string  see also : } ,   6convert a none negative Int into a hexadecimal string  see also : ~  ]take all elements of a list which occur more than once. The result does not contain doubles.  (doubles . doubles == doubles) :drop all elements from a list which occur more than once. remove duplicates from list )mothers little helpers for to much curry qrstuvwxyz{|}~qrstuvxwyz}~{| portablestableUwe Schmidt (uwe@fh-wedel.de)calls Data.Char.UTF8.decode for parsing and decoding UTF-8 portable experimentalUwe Schmidt (uwe@fh-wedel.de)/ ?!test for a legal 1 byte XML char !test for a legal latin1 XML char Cconversion from Unicode strings (UString) to UTF8 encoded strings. 9conversion from Unicode (Char) to a UTF8 encoded string. "checking for valid XML characters "checking for XML space character: \n, \r, \t and " " Fchecking for XML1.1 space character: additional space 0x85 and 0x2028  see also :   checking for XML name character &checking for XML name start character  see also :  &checking for XML NCName character: no ":" allowed  see also :  ,checking for XML NCName start character: no ":" allowed  see also : ,  %checking for XML public id character checking for XML letter checking for XML base charater &checking for XML ideographic charater $checking for XML combining charater checking for XML digit checking for XML extender 9checking for XML control or permanently discouraged char see Errata to XML1.0 (http:// www.w3.org/XML/xml-V10-2e-errata) No 46 )Document authors are encouraged to avoid compatibility characters, & as defined in section 6.8 of [Unicode]* (see also D21 in section 3.6 of [Unicode3]). F The characters defined in the following ranges are also discouraged. Q They are either control characters or permanently undefined Unicode characters: 'code conversion from latin1 to Unicode @Econversion from ASCII to unicode with check for legal ASCII char set +Structure of decoding function copied from Data.Char.UTF8.decode. 'UCS-2 big endian to Unicode conversion *UCS-2 little endian to Unicode conversion 8UCS-2 to UTF-8 conversion with byte order mark analysis gUTF-8 to Unicode conversion with deletion of leading byte order mark, as described in XML standard F.1 FUTF-16 big endian to UTF-8 conversion with removal of byte order mark IUTF-16 little endian to UTF-8 conversion with removal of byte order mark =substitute all Unicode characters, that are not legal 1-byte 0 UTF-8 XML characters by a character reference. :This function can be used to translate all text nodes and # attribute values into pure ascii.  see also :  =substitute all Unicode characters, that are not legal latin1 0 UTF-8 XML characters by a character reference. :This function can be used to translate all text nodes and # attribute values into ISO latin1.  see also :  Asubstitute selected characters  The check function returns  Byz, whenever a character needs to substitution  The function esc computes a substitute. 6removes all non ascii chars, may be used to transform 9 a document into a pure ascii representation by removing 1 all non ascii chars from tag and attibute names  see also : ,  7removes all non latin1 chars, may be used to transform 9 a document into a pure ascii representation by removing 1 all non ascii chars from tag and attibute names  see also : ,  3convert an Unicode into a XML character reference.  see also :  ?convert an Unicode into a XML hexadecimal character reference.  see also:  #White Space (XML Standard 2.3) and  end of line handling (2.11) #x0D and #x0D#x0A are mapped to #x0A CEthe table of supported character encoding schemes and the associated % conversion functions into Unicode:q 8the lookup function for selecting the decoding function D Similar to  C but it embeds errors & in the string of decoded characters. 8the lookup function for selecting the decoding function EBthe table of supported output encoding schemes and the associated # conversion functions from Unicode 8the lookup function for selecting the encoding function PDecoding function where decoding errors are interleaved with decoded characters cDecoding function with a pair containing the result string and a list of decoding errors as result 1UTF-8 strings are implemented as Haskell strings 3UTF-8 charachters are represented by the Char type the type for Unicode strings (Unicode is represented as the Char type C Precondition for this is the support of Unicode character range + in the compiler (e.g. ghc but not hugs) ,,!parse a single Unicode character parse a XML name character !parse a XML name start character parse a XML NCName character #parse a XML NCName start character parse a XML letter character White Space (2.3) end of line handling (2.11)  #x0D and #x0D#x0A are mapped to #x0A $ is done in XmlInput before parsing  otherwise #<x0D in internal parsing, e.g. for entities would normalize,  would be transformed portable experimentalUwe Schmidt (uwe@fh-wedel.de)lookup with default value 7lookup with empty list (empty string) as default value test for existence of a key ladd an entry, remove an existing entry before adding the new one at the top of the list, addEntry is strict !add a whole list of entries with  $delete an entry, delEntry is strict delete a list of entries with  lift IO command to  state inspection command: a "show"'-like function is applied to the state & and the result is written to stderr. @change the state with a given function and return the new state set the state read the state run a  command with an initial state portable experimentalUwe Schmidt (uwe\@fh-wedel.de)The interface for trees Xtree construction: a new tree is constructed by a node attribute and a list of children leaf construction: leafs don't have any children  definition:  mkLeaf n = mkTree n []  #leaf test: list of children empty? innner node test:  not . isLeaf  select node attribute select children edit node attribute edit children substitute node: " setNode n = changeNode (const n)  substitute children: , setChildren cl = changeChildren (const cl)  fold for trees all nodes of a tree depth of a tree number of nodes in a tree &format tree for readable trace output a  graphical+ representation of the tree in text format portable experimentalUwe Schmidt (uwe\@fh-wedel.de)<convert a tree into a pseudo graphical string reprsentation 'shortcut for a sequence of n-ary trees  n-ary ordered tree (rose trees) Aa tree consists of a node and a possible empty list of children. > If the list of children is empty, the node is a leaf, else it's  an inner node. (NTree implements Eq, Ord, Show and Read  portable experimentalUwe Schmidt (uwe\@fh-wedel.de)<Asatisfies converts a result of a predicate filter into a boolean is a shortcut for not . null typical use in guards or ifs: %if (satisfies f) t then ... else ...  ' 1.parameter f : the predicate filter ( 2.parameter t : the tree to be tested  returns : b = not (null (f t)) (the null filter, returns the empty list Ithe unit filter, returns the single element list containing the argument -conversion from predicate function to filter 5 1.parameter p : the predicate for testing the tree  returns :  or  depending on the predicate Gselect filter, selects trees with node values with a specific property ; 1.parameter p : the predicate for testing the node value  returns : [] or [t] depending on p t a special case of  filter  7filter for substituting an arbitray tree by a constant = 1.parameter t : the result tree, the input tree is ignored  returns : the filter  filter for replacing the node  1.parameter n : the new node  returns : the editing filter  "filter for replacing the children + 1.parameter cs : cs the list of children  returns : the filter  filter for editing the node - 1.parameter nf : the XNode editing funtion  returns : the filter  filter for editing the children Aall children are processed with a filter mapping lists to lists, ? this enables not only elementwise editing by lifting a normal  filter to a list filter with (f $$) (see '($$)') but also manipulation $ of the order of the elements, e.g. reverse is an appropriate childen  editing function. 2 1.parameter csf : the children editing function  returns : the filter  see also :  2filter for substituting the children of a tree by H a new list of childen computed by applying a filter to the input tree.   can be expressed by :  modifyChildren f t is equal to substChildren (f . getChildren) Hsequential composition of filters, usually written in infix notation f2  f1. %for predicate filter the logical AND ! 1.parameter f2 : the 2. filter ! 2.parameter f1 : the 1. filter b returns : the fiter applying first f1 to n and then f2 to the result (like function composition)  pronounced " followed by", defined as:  f .> g = g `o` f. Dallows filter composition in a more readable way from left to right ! 1.parameter f1 : the 1. filter ! 2.parameter f2 : the 2. filter ( returns : the composition of f1 and f2  see also : , '(..>)' *apply a list of filters sequentially with '(.>)',, for predicate filters the generalized AND  see also : '(.>)' Abinary parallel composition, the logical OR for predicate filter ! 1.parameter f1 : the 1. filter ! 2.parameter f2 : the 2. filter d returns : the filter for applying f1 and f2 both to an argument tree and concatenating the results  special sequential composition. &filter f is applied to an argument t. > then filter g is applied to all elements of the result list, < but the argument t is also passed as extra parameter to g. 7This allows for step by step transformations of a tree + with access to the original tree in every  transformation step.  see also : '(.>)',  apply a list of filters, a "union"5 for lists, for predicate filters the generalized OR ' 1.parameter fs : the list of filters  returns : the composing filter 7Filter for editing the children of a tree element wise 6 1.parameter cf : the filter applied to the children  returns : the editing filter  see also :  8infix operator for applying a filter to a list of trees  1.parameter f : the filter % 2.parameter ts : the list of trees , returns : the concatenated list of results ;directional choice, usually written in infix notation as f  g  1.parameter f : the 1. filter  2.parameter g : the 2. filter  3.parameter t : the tree } returns : the filter, that applies f to t, if the result is not the empty list, the result is found, else g t is the result if then else lifted to filters ' 1.parameter p : the predicate filter  2.parameter t : the "then" filter  3.parameter e : the "else" filter , returns : the resulting conditional filter Hwhen the predicate p holds, f is applied, else the identity filter this 2 1.parameter f : the conditinally applied filter  2.parameter p : the predicate " returns : the conditional filter  see also : , , , 5 !the complementary filter of when shortcut for f  neg g  see also : , , 6,  Dwhen the predicate p holds, f is applied, else the null filter none ' 1.parameter p : the predicate filter 3 2.parameter f : the conditionally applied filter " returns : the conditional filter  see also : , , 7 negation lifted to filters ' 1.parameter f : the predicate filter 4 returns : the filter, that succeeds, when f failed #multiway branch. The list of cases f :-> g is processed sequentially, F in the first case for that f holds g is applied, if no case matches,  is  applied. 1 This filter can be used like a case expression: ;choice [ p1 :-> f1, p2 :-> f2, ... , this :-> defaultFilter]  see also : , 4 bpruning: keep only those results from f for which g holds, usually written in infix notation as f  g ( 1.parameter f : the processing filter ' 2.parameter g : the predicate filter  3.parameter t : the tree M returns : all trees r from f t, for which g r holds (is not the empty list)  see also :    Bpruning: keep only those results from f for which g does not hold  see also :  !Opruning: monadic version of containing, usually written in infix notation as f ! g 0 1.parameter f : the monadic processing filter ' 2.parameter g : the predicate filter  3.parameter t : the tree M returns : all trees r from f t, for which g r holds (is not the empty list)  see also :   " pronounced "slash", meaning g inside f # pronounced "outside" meaning f containing g $top down search. *search terminates, when filter f succeeds H can e.g. be used for finding all outermost tag node of a specific kind %bottom up search. "first the children are processed, 8 if this does not succeed, the node itself is processed I can e.g. be used for finding all innermost tag nodes of a specific kind &%process all nodes of the whole tree. :can e.g. be used for finding all nodes of a specific kind 'bottom up transformation  1.parameter f : the simple transforming filter p returns : the filter that applies f to all subtrees and the tree itself in a deepth first left to right manner  see also : (, ) (top down transformation  1.parameter f : the simple transforming filter j returns : the filter that applies f first to the tree and then recursively to all subtrees of the result  see also : ' )Rguarded bottom up transformation, stops at subtrees for which a predicate p holds * 1.parameter f : the transforming filter 5 2.parameter p : the predicate filter for the guard 5 returns : the filter for processing all (sub-)trees  see also : ' *@top down transformation until a node to be transformed is found  1.parameter f : the simple transforming filter \ returns : the filter that applies f first to the tree and, if the filter does not succeed, 3 recursively to all children of the input tree.  Example:  processTopDownUntil none7is the identity filter (maybe a bit more inefficient).  Example:  processTopDownUntil (add1Attr "border" "2" ` containing` isTag "table")+is a filter for adding an attribute border="2" in all top level table tags. 5 The content of table tags will remain unchanged.  see also : (, ' +Ainsertion of trees into the list of children at a given position Museful for inserting something into the list of children at a given position ( the list of children is split with the splitAt function 4 the nodes are inserted between these two sublists.  examples: insertChildrenAt 0 ins t$ inserts all elements computed with ins t in front  of the childen of t, insertChildrenAt 1 ins t behind the first child  see also: , ,Einsertion of trees into the list of children after specific elements Cuseful for inserting something into the list of children of a node ( the list of children is split with the span( function and the filter p as predicate 3 the nodes are inserted between these two sublists  examples: insertChildrenAfter none ins t$ inserts all elements computed with ins t in front  of the childen of t, insertChildrenAfter this ins t& appends the elements to the children  see also: + -1the monadic version of the identity filter this.  see also :  .-the monadic version of the null filter none.  see also :  />sequential composition of monadic filters, monadic version of ".>". ) 1.parameter f1 : the 1. monadic filter ) 2.parameter f2 : the 2. monadic filter j returns : the monadic fiter applying first f1 to n and then f2 to the result (like function composition)  see also : '(.>)' 06generalized sequential composition of monadic filters 1Abinary parallel composition, the logical OR for predicate filter ! 1.parameter f1 : the 1. filter ! 2.parameter f2 : the 2. filter d returns : the filter for applying f1 and f2 both to an argument tree and concatenating the results  see also: , , 2 2 apply a list of monadic filters ' 1.parameter fs : the list of filters  returns : the composing filter  see also: , , 1 3monadic if-then-else.  1.parameter p : the predicate g 2.parameter thenP : the then part: the monadic filter, that is applied if p holds for the input tree $ 3.parameter elseP : the else part 2 returns : the monadic filter for the conditional 46monadic version of multiway branch. The list of cases f :-> g is processed sequentially, F in the first case for that f holds g is applied, if no case matches, . is  applied. 1 This filter can be used like a case expression: =choiceM [ p1 :-> f1, p2 :-> f2, ... , thisM :-> defaultFilter]  see also : , 3 5Wwhen the predicate p holds, the monadic filter f is applied, else the identity filter. : 1.parameter f : the conditinally applied monadic filter ' 2.parameter p : the simple predicate " returns : the conditional filter  see also : 3, , 7, 6 6#the complementary filter of whenM.  see also : 3, 5,  7Swhen the predicate p holds, the monadic filter f is applied, else the null filter. . 1.parameter p : the simple predicate filter ; 2.parameter f : the conditionally applied monadic filter " returns : the conditional filter  see also : 3, , 5 8@Filter for editing the children of a tree with a monadic filter > 1.parameter cf : the monadic filter applied to the children & returns : the monadic editing filter  see also :  9monadic variant of ( :monadic variant of ' ;Ainfix operator for applying a monadic filter to a list of trees, G typically used in do-notation for processing of intermediate results. % 1.parameter f : the monadic filter % 2.parameter ts : the list of trees , returns : the concatenated list of results  see also : '($$)' <"lift a filter to a monadic filter  1.parameter f : the simple filter & returns : the lifted monadic version =9run an arbitray command on a tree t and return the tree, ; used for inserting arbitray commands in a filter pipeline  1.parameter cmd : the command $ 2.parameter t : the argument tree 7 returns : the unchanged tree as a single element list >2auxiliary datatype for cases within choice filter @a filter for sequences AAtree filter type: a function mapping a tree onto a list of trees Pfilter can be used in various ways, as predicates, selectors, transformers, ... R      !"#$%&'()*+,-./0123456789:;<=>?@A>A@     >? "#$%&')(*+,-./01234567!89:<;=B*converts a n-ary tree in a navigable tree C*converts a navigable tree in a n-ary tree D>function for selecting the value of the current fragment tree LKleisli composition: O'navigable tree with nodes of type node Ia navigable tree consists of a n-ary tree for the current fragment tree, = a navigable tree for all ancestors, and two n-ary trees for & the previous- and following siblings a      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPBCDEFGHIJKLMNOPQRST Ubuilds the full name "prefix:localPart";, if prefix is not null, else the local part is the result V builds the " universal"1 name, that is the namespace uri surrounded with "{" and "}" followed by the local part  (specialisation of X) W builds an " universal"b uri, that is the namespace uri followed by the local part. This is usefull for RDF applications, b where the subject, predicate and object often are concatenated from namespace uri and local part  (specialisation of X) X{builds a string from the namespace uri and the local part. If the namespace uri is empty, the local part is returned, else d namespace uri and local part are combined with the combining function given by the first parameter Y-constructs a simple, namespace unaware name, p and r are set to the empty string. ZQconstructs a simple name, with prefix and localPart but without a namespace uri.  see also Y, [, \ [mconstructs a simple, namespace aware name, with prefix:localPart as first parameter, namspace uri as second.  see also Y, Z \aconstructs a simple name, with prefix:localPart as 1 parameter, with empty namspace uri, same as '/mkPrefixLocalPart, but with a single parameter  see also [, Z ] Empty QName ^GEquality of QNames: Two QNames are equal, if the local parts are equal # and the namespace URIs are equal. > The comparison works with and without namespace propagation. R If namespaces have been propagated, the name is split into prefix and local part ] and the namespace uri is set. In this case the prefix is not significant for equality test. W If namespaces have not been propagated, the local part contains the full name, prefix \ and namespace URI are empty. The full name (prefix and local part) is used for comparison. _UEquivalent QNames are defined as follows: The URIs are normalized before comparison.  Comparison is done with a and ` `.Comparison of normalized namespace URIs using b a*Sometimes a weaker equality relation than ^8 is appropriate, e.g no case significance in names, ... Y a name normalization function can be applied to the strings before comparing. Called by ^ and  _ b^Normalization of URIs: Normalization is done by conversion into lowercase letters. A trailing "/" is ignored cno error, everything is ok d%Error level for XError, type warning e#Error level for XError, type error f)Error level for XError, type fatal error h>data type for representing a set of nodes as a tree structure Ethis structure is e.g. used to repesent the result of an XPath query D such that the selected nodes can be processed or selected later in  processing a document tree jis this node part of the set ? kthe set of attribute nodes l?the set of child nodes, a list of pairs of index and node set mMType for the namespace association list, used when propagating namespaces by  modifying the n values in a tree n3Namespace support for element and attribute names. 9A qualified name consists of a name prefix, a local name  and a namespace uri. : All modules, which are not namespace aware, use only the q component. F When dealing with namespaces, the document tree must be processed by propagateNamespaces  to split names of structure "prefix:localPart"6 and label the name with the apropriate namespace uri p)the name prefix part of a qualified name "namePrefix:localPart" q#the local part of a qualified name "namePrefix:localPart" rthe associated namespace uri sAttribute list 8used for storing option lists and features of DTD parts tRepresents a DTD element Represents elements )List of nodes of xml tree representation  Node of xml tree representation ?UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~bUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&commonly useful options for XML input 6can be used for option definition with haskell getopt defines options: , , , , , ,  , , , , ,  , , , , , &available Relax NG validation options defines options   8,  :,  <, o ,   9,  ; 'commonly useful options for XML output defines options: , , ,  commonly useful options defines options: ,  defines  option debug output options <select options from a predefined list of option desciptions check whether an option is set Jreads the value of an attribute, usually applied to a document root node, P and checks if the value represents True. The following strings are interpreted  as true: "1", "True", "true", "yes", "Yes".   shortcut for U  shortcut for U Attribute name  Tag name BA function that takes a list of nodes and returns a list of nodes :A functions that takes a node and returns a list of nodes       !"#$%&'()*+,-./0123456789:;<=>?@AUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ DCompute the name prefix and the namespace uri for a qualified name. MThis function does not test whether the name is a wellformed qualified name.  see Namespaces in XML Rule [6] to [8]2. Error checking is done with separate functions,  see  and  for error checking. #test for wellformed NCName, rule [4] XML Namespaces "test for wellformed QName, rule [6] XML Namespaces  predicate is used in filter valdateNamespaces. "test for wellformed QName values. g A QName is wellformed, if the local part is a NCName, the namePrefix, if not empty, is also a NCName.  predicate is used in filter valdateNamespaces. ,test for a wellformed namespace declaration & all namespace prefixes starting with "xml"+ are reserved for XML related definitions.  predicate is used in filter valdateNamespaces. predicate is used in filter valdateNamespaces. {def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >qrstuvwxyz{|}~UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ portable experimentalUwe Schmidt (uwe@fh-wedel.de)U     U      !"#$%&'(! >Create a tree with a tag node. & 1.parameter n : the name of the tag ) 2.parameter al : the tag attribte list ( 3.parameter cs : the list of children  returns : the new tree ?Version with qualified name of >! @/create a tree with a namespace aware tag node. 2 1.parameter n : the prefix:localpart of the tag $ 2.parameter ns: the namespace uri ) 3.parameter al : the tag attribte list ( 4.parameter cs : the list of children  returns : the new tree  see also: >! A1creates a new document tree with empty contents. 7 1.parameter al : the attribute list for the root node )returns a single node tree with tag name "/" indicating a root and  with empty list of children  see also : B! Bthe empty document tree  see also : A! C:create a new empty document with source name as parameter DVcreate a new empty document with a list of attributes for source location and options  see also : C! Ecreate a document root tree. N 1.parameter al : the attribute list for the root. This list must contain at  least an attribute "source"7 that contains the URI of the document to be processed 5 2.parameter cs : the list for the document content  returns : the document root F"create a leaf for a text element.  1.parameter txt : the text = returns : the tree with the single node containing the text G$create a leaf for a char reference. < 1.parameter i : the integer representing the Unicode char G returns : the tree with the single node containing the char reference H'create a leaf for an entity reference. 3 1.parameter n : the name of the entity reference I returns : the tree with the single node containing the entity reference Icreate a leaf for a comment, # 1.parameter c : the comment text @ returns : the tree with the single node containing the comment J"create a tree for a part of a DTD + 1.parameter d : the type of the DTD part 7 2.parameter al : the attribute list for the DTD part J 3.parameter ds : the possibly empty list of components for the DTD part / returns : the tree with the composed DTD part KFcreate an attribute tree as part of a tag attribute list of tag nodes % 1.parameter al : the attribute name Z 2.parameter av : the attribute value as tree list, usually containing a single text node LQualified version of K! M*create an attribute tree with a namespace % 1.parameter al : the attribute name  2.parameter ns : namespace uri Z 3.parameter av : the attribute value as tree list, usually containing a single text node  see also: K!, @! N.create a parameter entity reference DTD part. . 1.parameter ref : the name of the reference $ returns : the DTD part for a PERef O&create a processing instruction tree. % 1.parameter n : the name of the PI ( 2.parameter str : the content of a PI C returns : the processing instruction tree with a single attribute "value" 6 with the str parameter as attribute value, with valueOf a_value applied to the result tree , the content of the PI can be selected Pcreate xml declaration Qcreate a CDATA section tree. 3 1.parameter s : the content of the CDATA section * returns : the tree for the CDATA section Rcreate an error tree. @ 1.parameter l : the level of the error (warning, error fatal) & 2.parameter msg : the error message = 3.parameter cs : the context, where the error was detected X-convert the result of a filter into a string  see also : Z! for filter version, #Text.XML.HXT.Parser.XmlParsec.xread for the inverse operation Y old name for X! (deprecated) Z/conversion of a filter result into a text node  see also : X! t6select the name of a node. For tags, attributes and pi's the name string % is returned, else the empty string. uPselect the local part of a name of a node. For tags, attributes the name string  is returned, for pi')s the whole name, else the empty string. vZselect the namespace URI of a tag or an attribute tree, else the empty string is returned  see also : t! w]select the namespace prefix of a tag or an attribute tree, else the empty string is returned  see also : t!, u! xxselect the universal name (namespace uri ++ localPart) of a tag or an attribute tree, else the empty string is returned  see also : t!, v! y$select the attributes of a dtd tree z)select a special attribute of a DTD part { test an attribute of a DTD part ])*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~])*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"b?test whether the root of a tree contains a document root node. 5test whether the root of a tree contains a tag node.  see also: " rnamespace aware test whether the root of a tree contains a tag node. Parameters are the local part and namespace. * Only usable after namespace propagation.  see also: " 7test whether the root of a tree has a given local name  see also : ", ", ", " 8test whether the root of a tree has a given prefix name  see also : ", ", ", " =test whether the root of a tree belongs to a given namespace  see also : ", ", ", " Itest whether the root of a tree contains a tag node with a special name. atest whether the node of a tree is a XTag node or a XPi node with an attibute of a specific name  see also: ", " atest whether the tree is a XTag node with an attibute of a specific local name and namespace uri  see also: ", " rtest whether the given node is a XTag node or a XPI node with an attribute with a value with a specific property. h In case of a match, the attribute value represented by a text node is returned as single element list, $ else the empty list is the result.  see also : " Etest whether the tree is a processing instruction with a given name. test whether the tree is a < ?xml ... ?> declaration Utest whether the root of a tree contains a processing instruction of a special name. 7test whether the root of a tree contains a CDATA node. Etest whether the root of a tree contains a character reference node. 9test whether the root of a tree contains a comment node. 5test whether the root of a tree contains a DTD part. Ctest whether the root of a tree contains an entity reference node. 8test whether the root of a tree contains an error node. Htest whether the root of a tree contains a processing instruction node. 5test whether the root of a tree contains a tag node. <test whether the root of a tree contains an attribute node. Ptest whether the root of a tree is an attribute node for a given attribute name namespace aware test whether the tree contains an attribute node. Parameters are the local part of the atribute name and the namespace. * Only usable after namespace propagation.  see also: ", ", " #general test for an attribute name 6test whether the root of a tree contains a text node. 9test whether the root of a tree contains a special text. Mtest whether the root of a tree contains a text node with a special property Ktest whether the root of a tree contains a text node only with whitespace. =test whether the root of a tree contains a DOCTYPE DTD part. >test whether the root of a tree contains an ATTLIST DTD part. >test whether the root of a tree contains an ELEMENT DTD part. =test whether the root of a tree contains an ENTITY DTD part. Gtest whether the root of a tree contains a parameter ENTITY reference. :test whether the root of a tree contains a DTD name part. Itest whether the root of a tree contains a conditional section DTD part. Itest whether the root of a tree contains a parameter entity declaration. >test whether the root of a tree contains a NOTATION DTD part. Ftest whether the root of a tree contains an error node for a warning. Etest whether the root of a tree contains an error node for an error. Jtest whether the root of a tree contains an error node for a fatal error. #constructor filter for a tag node.  a new tree is constructed. a the attributes and the children are computed by applying the aproprate filter to the input tree  1.parameter n : the tag name 5 2.parameter af : the filter for the attribute list / 3.parameter cf : the filter for the children " returns : the constructor filter  Version with qualified names of " #constructor filter for a tag node.  a new tree is constructed. a the attributes and the children are computed by applying the aproprate filter to the input tree ; 1.parameter n : the tag name in form of prefix:localpart % 2.parameter ns: the namespace uri 5 3.parameter af : the filter for the attribute list / 4.parameter cf : the filter for the children " returns : the constructor filter #filter for attribute construction. A a new tree with attribute name and a value computed by a filter  is build. Qualified version " #filter for attribute construction. O a new tree with attribute name and namespace and a value computed by a filter  is build. $constructor filter for a text node.  a new tree is constructed.  the input tree is ignored. 3constructor filter for a character reference node.  a new tree is constructed.  the input tree is ignored. 1constructor filter for an entity reference node.  a new tree is constructed.  the input tree is ignored. 'constructor filter for a comment node.  a new tree is constructed. 4 the xml string representation of the filter result  forms the comment #constructor filter for a DTD part.  a new tree is constructed.  the input tree is ignored. -constructor filter for a CDATA section node.  a new tree is constructed.  the input tree is ignored. 0constructor filter for a processing instruction 8 a new tree is constructed from the text representation  of the input tree .constructor filter for an error message node.  a new tree is constructed.  the input tree is ignored. Mfilter for selecting the name of a tag node, an attribute node or a pi node. R Result of the filter is a single element list with a text node or the empty list 'filter for selecting the attibute list >filter for selecting the value of an attribute in a tag node. R Result of the filter is a single element list with a text node or the empty list  see also : ", " Mfilter for selecting the value of an attribute with namespace in a tag node. R Result of the filter is a single element list with a text node or the empty list  see also : ", " 1filter for selecting an attribute of a DTD node. R Result of the filter is a single element list with a text node or the empty list +filter for selecting content of a comment. R Result of the filter is a single element list with a text node or the empty list (filter for selecting the CDATA content. R Result of the filter is a single element list with a text node or the empty list Gedit filter for changing the name of a tag node, an attribute or a pi. Q result of the filter is a single element list with a tag node or the empty list 2edit filter for changing the text of a text node. R result of the filter is a single element list with a text node or the empty list Cexample for editing all text nodes of a tree with an edit function f: processBottomUp (modifyText f `when` isXText)1edit filter for changing the name of a tag node. R result of the filter is a single element list with a text node or the empty list Bprocess the attribute list of a tag node with a tree list filter. ' for other trees this filter acts like  3elementwise processing of the attributes of a tag. ' for other trees this filter acts like   see also : " replace an attribute list / to be renamed when replaceAttrl is eliminated :delete an attribute from the attribute list of a tag tree 1add an attribute to the attribute list of a tag. $ If the attribute already exists, it's substituted,  see also: ", " 2adds an attribute list computed by a filter, uses ".  see also: " Padd or change an attribute with a given string as value for a XTag or XPi tree,  uses ". .add or change an attribute with an Int value.  uses ". Bedit filter for changing the value of an attribute in a tag node. T result of the filter is a single element list with the tag node or the empty list. , 1.parameter n : the name of the attribute < 2.parameter f : the edit function for the attribute value  returns : the edit filter )add or change an attribute of a DTD tree 3convenient function for tag node tree construction  infixl 7 ,filter combinator for tag tree constrcution T take a 1. filter for computing a tag node tree (or a whole list of tag node trees) c then add all trees computed by the 2. filter to the attribute list when they represent attributes + else append them to the list of children. cif the 1. filter computes a list of tag nodes, the results of the 2. filter are added to all trees  example:  etag "a" += sattr "href" "#42" += txt " the answer"   gives the tree  <a href="#42"> the answer</a>   example:  ( etag "a" +++ etag "b" ) += sattr "x" "42"   gives the tree  <a x="42"/><b x="42"/>   see also : ", ", ", , " _convenient filter function adding a whole list of trees, just for not writing to many ( ... ).  infixl 7   f ++= gl == f += cat gl see also : " combination of " and conversion into a String combination of " and conversion to a Int dvariant of mkXTag with a list of filters for the attributes and a list of filters for the children. T this variant leads to a more readable source for a complicated construction filter 0 than the simple solution with a combination of " and .  see also : ", ", ", , " Rvariant of tag, useful for tags without attributes and with a list of filters for  constructing the children  see also : ", ", ", , " Evariant of tag, useful for tags with attributes but without children  see also : ", ", ", ",  ,Short cut for empty tags without attributes  see also : ", ", ", " and " Qualified version of etag Alias for mkQTag {filter for creating a document root node with a list of filters for the attributes and a list of filters for the document.  see also : "  Alias for " Alias for mkQAttr ;short cut for attribute construction with string constants  set also : ", " and " short cut for " short cut for simple comment  the input tree is ignored  see also : " >short cut for generating simple processing instructions (spi)  the input tree is ignored spi "xyz" "abc" is equal to mkXPi "xyz" (txt "abc") * (the name pi is already used in prelude) 0short cut for generating simple cdata sections,  the input tree is ignored <DTD part generation with filter for attributes and children  see also: J! short cut for mkXError c_warn.  see also : "  short cut for mkXError c_fatal.  see also : "  short cut for mkXError c_fatal.  see also : " check whether an option is set Jreads the value of an attribute, usually applied to a document root node, P and checks if the value represents True. The following strings are interpreted  as true: "1", "True", "true", "yes", "Yes". rr|def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >      !"#$%&'()*+,-./0123456789:;<=>?@AUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#$1change the user state 3 1.parameter fct : the user state change function  returns : the new state set the user state.  1.parameter s : the new state  returns : the new state read the user state  returns : the current state %change the system part of the state.  see also : $ "set the system part of the state.  see also : $ #read the system part of the state.  see also : $ the initial system state 'an empty list of attribute value pairs *change the attributes in the system state set the error message handler get the error handler )set or change a single system parameter. / 1.parameter name : the name of the parameter 3 2.parameter value : the list of associated trees  returns : nothing  see also : $, $ 8set or change a single system parameter of type string. / 1.parameter name : the name of the parameter - 2.parameter value : the (new) string value  returns : nothing  see also : $, setSysParamInt 5set or change a single integer type system parameter  see also : $ Hadd (or change) all attributes of the document root to the system state  - returns : this read a system parameter / 1.parameter name : the name of the parameter ^ returns : the list of tres associated with the key, or the empty list for unknown parameters  read a system string parameter / 1.parameter name : the name of the parameter A returns : the value, or the empty string for unknown parameters  2read a system parameter or return a default value / 1.parameter name : the name of the parameter * 2.parameter default : the default value 0 returns : the value if found, else the default  !read an integer system parameter  1.parameter name :  2.parameter default :  see also :  $  *exec a XState command with initial state. 2 1.parameter initalState : the inital user state  2.parameter cmd : the command  returns : the i/%o command with result and user state  /exec a XState command with initial user state.  ignore final user state. 0 like run0, but ignore the resulting user state &exec a XState command in th IO monad. # like run with the empty state (). #run a command in a new user state.  chain the system state part, A init new system state with the current one, run the command and A update the old system state with the resulting new system state 8 1.parameter initialUserState : the initial user state  2.parameter cmd : the command ; returns : the result of executing cmd and the final state  like chain'! but forget the final user state 8 1.parameter initialUserState : the initial user state  2.parameter cmd : the command , returns : only the result of executing cmd ,lift a XmlFilter to a XmlStateFilter filter ) issue all error nodes as error messages , and remove the error nodes from the result  1.parameter f : the filter 1 returns : the filter running in the state monad =all errors are filtered from the result and issued on stderr  lift an I/ O command  1.parameter cmd : the i/ o command  returns : the i/(o command lifted to the XML state monad set the trace level.  convention: 0: no trace output (default) @1: trace important computation steps, e.g. accessing a document !2: trace small computation steps >3: output an intermediate result XmlTree in XML source format @4: output an intermediate result XmlTree in tree representation & 1.parameter level : the trace level  returns : nothing get the current trace level. # returns : the current trace level $trace output for arbitray commands. ' 1.parameter level : the trace level, , for which the command will be execuded  if level <= current trace level / 2.parameter cmd : the command to be executed  returns : nothing 'trace output function for simple text. ' 1.parameter level : like in traceCmd  2.parameter str : the test  returns : nothing 4trace output of the user part of the program state. ' 1.parameter level : like in traceCmd . 2.parameter showFct : the toString function  returns : nothing $filter to reset the state attribute   - returns : this report an error message. 4 returns : if the input tree n represents an error, res = [] a and the error is processed by the errror handler filter (default: error is issued on stderr)  else res = [n]  see also : "$ $set the error level in system state 3default error handler for writing errors to stderr 8error message handler for collecting all error messages ) all messages are stored under attribute   they can be read with getSysParamTree a_error_log or by  applying the filter $ to the root node 3the filter for reading all collected error mesages @result is the list of error messages, the input tree is ignored  error level translation  d (1) : warning,  e7 (2): error (e.g. parse error, validation error, ...),  f@ (3) : fatal error (document access error, internal error, ...) ! short cut for issuing a warning  see also : $, "$ "short cut for issuing an error  see also : $ #$short cut for issuing a fatal error  see also : $, "$ %"checks the value of the attribute  in a document root. , if it contains a value greater or equal to e, an error with error message  stored in attribute & is issued and the filter acts as the . filter  else its the - filter &;add the error level and the module where the error occured e to the attributes of a document root node and remove the children when level is greater or equal to e 'Ucheck whether tree is a document root and the status attribute has a value less than e (<check whether the error level attribute in the system state E is set to error, in this case the children of the document root are 4 removed and error info is added as attributes with &$  else nothing is changed );monadic filter for processing the attribute list of a tag. ' for other trees this filter acts like .  see also : ", " *The  XmlFilter% type for filters working on a state +2The monad type for commands. It is an instance of StateIO from the  general module Control.Monad.MonadStateIO. ,'The State has a system and a user part $ the user state is a type parameter 1AThe internal system state consists of a list of name-value pairs  of type (String, XmlTrees)-, so arbitrary lists of trees can be stored. H For options, often only strings are used as values, so a set of access + functions with string values is available I The error handling method can be controlled by an error handler filter, 0 the default filter issues the errors on stderr ;      !"#$%&'()*+,-./01234?      !"#$%&'()*+,-./012345678%9remove Comments : remove all Comments recursively ;'simple filter for removing whitespace. +no check on sigificant whitespace is done.  see also : <%, I% <5simple recursive filter for removing all whitespace. Bremoves all text nodes in a tree that consist only of whitespace.  see also : ;%, I% =Fconverts CDATA sections in whole document tree into normal text nodes >,converts CDATA section in normal text nodes ?/converts CDATA sections in whole document tree @/converts CDATA section in normal text sections A-converts character references to normal text B=recursively converts all character references to normal text C Applies some  Canonical XML rules to the nodes of a tree. MThe rule differ slightly for canonical XML and XPath in handling of comments KNote: This is not the whole canonicalization as it is specified by the W3C R Recommendation. Adding attribute defaults or sorting attributes in lexicographic  order is done by the  transform function of module !Text.XML.HXT.Validator.Validation. F Replacing entities or line feed normalization is done by the parser. Not implemented yet: 4 Whitespace within start and end tags is normalized c Special characters in attribute values and character content are replaced by character references see D% and E% D*canonicalize tree and remove comments and <?xml ... ?> declarations see C% ECanonicalize a tree for XPath  Comment nodes are not removed see C% F=Collects sequences of child XText nodes into one XText node. G#Applies collapseXText recursively.  see also : F% H:filter for indenting a document tree for pretty printing. Dthe tree is traversed for inserting whitespace for tag indentation. >whitespace is only inserted or changed at places, where it isn't significant,  is'Fs not inserted between tags and text containing non whitespace chars. :whitespace is only inserted or changed at places, where it's not significant. < preserving whitespace may be controlled in a document tree  by a tag attribute  xml:space &allowed values for this attribute are default | preserve. #input is a complete document tree. 4 result the semantically equivalent formatted tree.  see also : I% I4filter for removing all not significant whitespace. 9the tree traversed for removing whitespace between tags, 4 that was inserted for indentation and readability. / whitespace is only removed at places, where it's not significat < preserving whitespace may be controlled in a document tree  by a tag attribute  xml:space &allowed values for this attribute are default | preserve 4input is root node of the document to be cleaned up 4 output the semantically equivalent simplified tree  see also : H%, <% Fescape XmlText, / transform all special XML chars into CharRefs J8convert the special XML chars in a text or comment node  into character references  see also L% K9convert the special XML chars in an attribute value into ; charachter references. Not only the XML specials but also \n, \r and \t are converted  see also: L%, J% Lconvert the special XML chars ", <, >, & and '# in a document to char references, % attribute values are converted with K%  see also: J%, K% M=convert a document tree into an output string representation & with respect to the output encoding. 6The children of the document root are stubstituted by A a single text node for the text representation of the document. 3Encoding of the document is performed with respect  to the output-encoding0 attribute in the root node, or if not present,  of the encoding, attribute for the original input encoding. D If the encoding is not specified or not supported, UTF-8 is taken. OPconvert a document into a text and add line numbers to the text representation. 8Result is a root node with a single text node as child. ( Useful for debugging and trace output.  see also : R%, Q% Q<convert a document into a text representation in tree form. 'Useful for debugging and trace output.  see also : R%, O% R>convert a document into a Haskell representation (with show). 'Useful for debugging and trace output.  see also : Q%, O% 9:;<=>?@ABCDEFGHIJKLMNOPQRSCDEFGH;<I9:@?>=ABLJKMOPQRSN&T%propagate all namespace declarations " xmlns:ns=..." to all ( tag and attribute nodes of a document. :This filter does not check for illegal use of namespaces.  The real work is done by U&. 4The filter may be applied repeatedly if neccessary. U9attaches the namespace info given by the namespace table 0 to a tag node and its attributes and children. V4validate the namespace constraints in a whole tree. 5 result is the list of errors concerning namespaces.  Work is done by applying W& to all nodes.  Predicates , ,   and 5 are applied to the appropriate tags and attributes. W(a single node for namespace constrains. YMType for the namespace association list, used when propagating namespaces by  modifying the n values in a tree TUVWXYTUVWXY'Z$document output for standard output  see also : [' [%document output for arbitrary files. Result is the input document \%document output on a given file name Result is the input document  see also : [', Z' ](output of tree representation for trace _(output of text representation for trace Z[\]^_`abcd Z\^`[]_abcd(eTpropagate all namespace declarations, check namespace constraints and issue errors. O If no error was found, result is the unchanged input tree, else the root node "/"% with an empty document is returned.  see also : T&, V& TUVWXYee}idef   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >      !"#$%&'()*+,-./0123456789:;<=>?@AUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./012349:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYe)ff*portable experimentalUwe Schmidt (uwe@fh-wedel.de)5ghijklmnopqrstuvwxyz{|}~5kuy|zt~lpmoq{wnxrsijghv}+,-./0portable experimentalUwe Schmidt (uwe@fh-wedel.de)1portable experimentalUwe Schmidt (uwe@fh-wedel.de) the inverse function to X!, (for XML content). <the string parameter is parsed with the XML content parser. S result is the list of trees or in case of an error a single element list with the D error message as node. No entity or character subtitution is done.  see also: 1 the filter version of 1 a more general version of 1. ; The parser to be used and the context are extra parameter <general parser for parsing arbitray parts of a XML document Parser for parts of a DTD Parser for general entites Parser for attribute values Parser for NMTOKENs Parser for XML names "try to parse a xml encoding spec. : 1.parameter encParse : the parser for the encoding decl % 2.parameter root : a document root 1 returns : the same tree, but with an additional  attribute encoding in the root node & in case of a valid encoding spec  else the unchanged tree ""23)The monadic parser for a whole document. 5 input must be a root node with a single text child. : Error messages are issued and global error state is set. `Filter for substitution of all occurences of the predefined XML entites quot, amp, lt, gt, apos $ by equivalent character references Yghijklmnopqrstuvwxyz{|}~4 1filter for reading the content of a XML document 4input is a root node with the source as an attibute > the text is read, the encoding scheme is parsed and selected K and the input is translated into the internal UTF-8 string representation 9filter for reading the content of an external XML entity  see also : 4 (filter command for saving and restoring  the base URI @ 1.parameter f : the filter that possible changes the base URI a returns : a filter with the same effect as f, that restores the base URI after application of f :filter command for running an action in a new URI context 2guessEncoding uses encoding attribute and content # to determine the encoding scheme. it'Vs assumed that an encoding spec has been tried to parse before guessing the encoding. UTF-8 is the default encoding Fother supported encodings are ISO-8859-1 (also known as ISO-Latin-1), 9 US-ASCII, UTF-16 or ISO-10646-UCS-2, UTF-16BE, UTF-16LE Gset the base URI, all other URIs are handled relative to this base URI the default base URI is file:///<current-working-dir>/  see also : 4 read the current base URI  see also : 4 @transform an URI into an absolut URI using the current base URI & 1.parameter uri : the URI as string ( returns : the absolut URI as string or "" in case of an error 8predicate for testing the standalone document attribute the hard io operations 4for reading a file or accessing a document via http " input must be a root node with a source attribute specifying the URI >compute the length of the data for a document read previously  by a call of '5getUrlContents. The result is stored as an attribute 8 value in the document root node. the attribute name is   5"read a document and parse it with 5&. The main entry point of this module +The input tree must be a root tree like in ', Text.XML.HXT.Parser.MainFunctions.getXmlDoc'. The content is read with 4,  is parsed with 5I and canonicalized (char refs are substituted in content and attributes,  but comment is preserved)  see also : 2Text.XML.HXT.Parser.DTDProcessing.getWellformedDoc The HTML parsing filter The input is parsed with 5%, everything is interpreted as HTML, R if errors ocuur, the parser will try to do some meaningfull action and continues P parsing. Afterwards the entitiy references for defined for XHTML are resovled, : any unresolved reference is transformed into plain text. Error messages Y during parsing and entity resolving are added as warning nodes into the resulting tree. HThe warnings are issued, if the 1. parameter noWarnings is set to True, 5 afterwards all are removed from the resulting tree. )The pure HTML parser, usually called via 5. 67Tests whether a URI matches the Relax NG anyURI symbol 'Tests whether two URIs are equal after 6 is performed =Converts all letters to the corresponding lower-case letter  and removes a trailing "/" *Tests whether a string matches a number [-](0-9)* 0Formats a list of strings into a single string. =The first parameter formats the elements, the 2. is inserted between two elements.  example: I formatStringList show ", " ["foo", "bar", "baz"] -> "foo", "bar", "baz" Formats a qualified name, e.g. "{namespace}localName"  7portable experimentalUwe Schmidt (uwe@fh-wedel.de)=parse a tokenized DTD declaration represented by a DTD tree. b The content is represented by the children containing text and parameter entity reference nodes. c The parameter entity reference nodes contain their value in the children list, consisting of text f and possibly again parameter entity reference nodes. This structure is build by the parameter entity  substitution. n Output is again a DTD declaration node, but this time completely parsed and ready for further DTD processing G7collect the tokens of a DTD declaration body and build J a string ready for parsing. The structure of the parameter entity values N is stll stored in this string for checking the scope of the parameter values 8portable experimentalUwe Schmidt (uwe@fh-wedel.de)Hmonadic filter for reading, parsing and checking a wellformed document. D the input tree must consist of a root node with a source attribute  in its attribute list. HAll attributes from the document root are copied into the system state, @ and may be queried by the monadic filters, e.g. trace options. KResult is the single element list containing the well-formed document tree I or, in case of errors, the document root with an empty list as children  and attributes  and ! for error level and the module,  where the error occured. this is a shortcut for 4 .>> 8 example for a main program:   main =  run' $  do  res <- getWellformedDoc $ newDocument " myfile.xml"  ... parses a text node with 3), processes the DTD and general entities 4 and transforms all char references into characters a filter for DTD processing $inclusion of external parts of DTD,  parameter entity substitution  conditional section evaluation Binput tree must represent a complete document including root node Hsubstitute parameter entities V result is the input tree with the list of text nodes as children or an error message I-the dtd parameter entity substitution filter JJmerge the external and the internal part of a DTD into one internal part. J parameter entity substitution should be made before applying this filter + internal definitions shadow external ones #preliminary: no real merge is done !substitution of general entities 4input: a complete document tree including root node 9IChecks if the attribute value meets the lexical constraints of its type. , 1.parameter dtdPart : the children of the DOCTYPE node G 2.parameter attrDecl : the declaration of the attribute from the DTD E returns : a function which takes an element (XTag or XDTD ATTLIST), P checks if the attribute value meets the lexical constraints = of its type and returns a list of errors K5Dispatches the attibute check by the attribute type. ' 1.parameter typ : the attribute type , 2.parameter dtdPart : the children of the DOCTYPE node G 3.parameter attrValue : the normalized attribute value to be checked G 4.parameter attrDecl : the declaration of the attribute from the DTD F returns : a functions which takes an element (XTag or XDTD ATTLIST), T checks if the attribute value meets the lexical constraints A of its type and returns a list of errors L8Checks the value of Enumeration attribute types. (3.3.1 / p.27 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked M3Checks the value of ENTITY attribute types. (3.3.1 / p.26 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node, to get the 1 unparsed entity declarations G 2.parameter attrDecl : the declaration of the attribute from the DTD G 3.parameter attrValue : the normalized attribute value to be checked N5Checks the value of ENTITIES attribute types. (3.3.1 / p.26 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node, to get the 1 unparsed entity declarations G 2.parameter attrDecl : the declaration of the attribute from the DTD G 3.parameter attrValue : the normalized attribute value to be checked O4Checks the value of NMTOKEN attribute types. (3.3.1 / p.26 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked P5Checks the value of NMTOKENS attribute types. (3.3.1 / p.26 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked Q/Checks the value of ID attribute types. (3.3.1 / p.25 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked R2Checks the value of IDREF attribute types. (3.3.1 / p.26 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked S3Checks the value of IDREFS attribute types. (3.3.1 / p.26 in Spec) G 1.parameter attrDecl : the declaration of the attribute from the DTD G 2.parameter attrValue : the normalized attribute value to be checked T/Checks if the value of an attribute is a name. - 1.parameter msg : error message, should be Entity or Attribute value G 2.parameter attrDecl : the declaration of the attribute from the DTD G 3.parameter attrValue : the normalized attribute value to be checked UFGets the element name from an attribute list of an XDTD ATTLIST node. 9 1.parameter tag : the attibute list of an XDTD ATTLIST  returns : the element name VHGets the attribute name from an attribute list of an XDTD ATTLIST node. 9 1.parameter tag : the attibute list of an XDTD ATTLIST  returns : the attribute name ?Normalizes an attribute value with respect to its type. (3.3.3 / p.29 in Spec) Q 1.parameter attrDecl : the declaration of the attribute from the DTD. Expected K is a list. If the list is empty, no declaration exists. ; 2.parameter value : the attribute value to be normalized  returns : the normalized value W)Normalization of CDATA attribute values.  is already done when parsing 0 during entity substituion for attribute values X4Normalization of attribute values other than CDATA. Y4Reduce whitespace sequences to a single whitespace. :Validate a DTD. I returns : a functions which takes the DTD subset of the XmlTree, checks C if the DTD is valid and returns a list of errors Z Returns a list of XText values. 0 1.parameter xtextList : a list of XText nodes ) returns : the values of the XText nodes [BValidation of Notations, checks if all notation names are unique. 0 Validity constraint: Unique Notation Name (4.7 / p.44 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node  returns : a list of errors \Validation of Entities. =1. Issues a warning if entities are declared multiple times. Optional warning: (4.2 / p.35 in Spec) A2. Validates that a notation is declared for an unparsed entity. .Validity constraint: Notation Declared (4.2.2 / p.36 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node M 2.parameter notationNames : list of all notation names declared in the DTD  returns : a list of errors ]$Validation of Element declarations. =1. Validates that an element is not declared multiple times. :Validity constraint: Unique Element Type Declaration (3.2 / p.21 in Spec) T2. Validates that an element name only appears once in a mixed-content declaration. -Validity constraint: No Duplicate Types (3.2 / p.21 in Spec) V3. Issues a warning if an element mentioned in a content model is not declared in the  DTD. Optional warning: (3.2 / p.21 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node H 2.parameter elemNames : list of all element names declared in the DTD  returns : a list of errors ^&Validation of Attribute declarations.  M Issues a warning if an attribute is declared for an element type not itself  decared. Optinal warning: (3.3 / p. 24 in Spec) I2. Issues a warning if more than one definition is provided for the same J attribute of a given element type. Fist declaration is binding, later  definitions are ignored. Optional warning: (3.3 / p.24 in Spec) M3. Issues a warning if the same Nmtoken occures more than once in enumerated . attribute types of a single element type. Optional warning: (3.3.1 / p.27 in Spec) N4. Validates that an element type has not more than one ID attribute defined. 4Validity constraint: One ID per Element Type (3.3.1 / p.26 in Spec) T5. Validates that an element type has not more than one NOTATION attribute defined. :Validity constraint: One Notation per Element Type (3.3.1 / p.27 in Spec) 06. Validates that an ID attributes has the type  IMPLIED or  REQUIRED. 1Validity constraint: ID Attribute Default (3.3.1 / p.26 in Spec) 97. Validates that all referenced notations are declared. 0Validity constraint: Notation Attributes (3.3.1 / p.27 in Spec) A8. Validates that notations are not declared for EMPTY elements. 9Validity constraint: No Notation on Empty Element (3.3.1 /p.27 in Spec) I9. Validates that the default value matches the lexical constraints of it's type. 4Validity constraint: Attribute default legal (3.3.2 / p.28 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node H 2.parameter elemNames : list of all element names declared in the DTD M 3.parameter notationNames : list of all notation names declared in the DTD  returns : a list of errors IRemoves doublicate declarations from the DTD, which first declaration is @ binding. This is the case for ATTLIST and ENTITY declarations. L returns : A function that replaces the children of DOCTYPE nodes by a list < where all multiple declarations are removed. ; &filter for transforming the document. - 1.parameter dtdPart : the DTD subset (Node DOCTYPE) of the XmlTree 7 2.parameter doc : the document subset of the XmlTree  returns : a list of errors _"Traverse the XmlTree in preorder. a 1.parameter transEnv : lookup-table which maps element names to their transformation functions * returns : the whole transformed document `$Build all transformation functions. D 1.parameter dtdPart : the DTD subset, root node should be of type DOCTYPE S returns : lookup-table which maps element names to their transformation functions a?Build a transformation function for the document root. By root / U is meant, which is the topmost dummy created by the parser. This function is only a  dummy, too. & returns : entry for the lookup-table b/Build transformation functions for an element. , 1.parameter dtdPart : the children of the DOCTYPE node R 1.parameter nd : element declaration for which the transformation functions are  created & returns : entry for the lookup-table c:Sort the attributes of an element in lexicographic order. ? returns : a function which takes an element (XTag), sorts its T attributes in lexicographic order and returns the changed element dNormalize attribute values. D returns : a function which takes an element (XTag), normalizes its C attribute values and returns the changed element e2Set default attribute values if they are not set. L returns : a function which takes an element (XTag), adds missing attribute ; defaults and returns the changed element fMLookup-table which maps element names to their transformation functions. The * transformation functions are XmlFilters. <ADerives a regular expression with respect to a list of elements. & 1.parameter re : regular expression Q 2.parameter list : list of elements to which the regular expression is applied * returns : the derived regular expression g:Derives a regular expression with respect to one element. L(delta e x) = x  L(e) 4 1.parameter re : regular expression to be derived J 2.parameter el : the element on which the regular expression is applied * returns : the derived regular expression     =Validate a document. - 1.parameter dtdPart : the DTD subset (Node DOCTYPE) of the XmlTree 7 2.parameter doc : the document subset of the XmlTree  returns : a list of errors h"Traverse the XmlTree in preorder. \ 1.parameter valiEnv : lookup-table which maps element names to their validation functions  returns : list of errors i Build all validation functions. @ 1.parameter dtdPart : DTD subset, root node should be of type DOCTYPE O returns : lookup-table which maps element names to their validation functions j@Build a validation function for the document root. By root node / = is meant, which is the topmost dummy created by the parser. @ 1.parameter dtdPart : DTD subset, root node should be of type DOCTYPE & returns : entry for the lookup-table k+Build validation functions for an element. , 1.parameter dtdPart : the children of the DOCTYPE node N 2.parameter nd : element declaration for which the validation functions are  created & returns : entry for the lookup-table l@Build validation functions for the content model of an element. ' Validity constraint: Element Valid (3 / p.18 in Spec) R 1.parameter nd : element declaration for which the content validation functions  are built C returns : a function which takes an element (XTag), checks if its P children match its content model and returns a list of errors mJBuild a regular expression from the content model. The regular expression " is provided by the module XmlRE. 8 1.parameter nd : node of the content model. Expected: CONTENT or  NAME 3 returns : regular expression of the content model n=Build validation functions for the attributes of an element. , 1.parameter dtdPart : the children of the DOCTYPE node T 2.parameter nd : element declaration for which the attribute validation functions  are created C returns : a function which takes an element (XTag), checks if its D attributes are valid and returns a list of errors o7Validate that all attributes of an element are unique. 0 Well-formdness constraint: Unique AttSpec (3.1 / p.19 in Spec) C returns : a function which takes an element (XTag), checks if its E attributes are unique and returns a list of errors pValidate that all #"REQUIRED attributes are provided. 1 Validity constraint: Required Attributes (3.3.2 / p.28 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node K 2.parameter nd : element declaration which attributes have to be checked C returns : a function which takes an element (XTag), checks if all P required attributes are provided and returns a list of errors qValidate that #*FIXED attributes match the default value. 5 Validity constraint: Fixed Attribute Default (3.3.2 / p.28 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node K 2.parameter nd : element declaration which attributes have to be checked C returns : a function which takes an element (XTag), checks if all X fixed attributes match the default value and returns a list of errors rCValidate that an element has no attributes which are not declared. 0 Validity constraint: Attribute Value Type (3.1 / p.19 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node K 2.parameter nd : element declaration which attributes have to be checked C returns : a function which takes an element (XTag), checks if all G attributes are declared and returns a list of errors sMValidate that the attribute value meets the lexical constraints of its type. / Validity constaint: Attribute Value Type (3.1 / p.19 in Spec) , 1.parameter dtdPart : the children of the DOCTYPE node K 2.parameter nd : element declaration which attributes have to be checked C returns : a function which takes an element (XTag), checks if all W attributes meet the lexical constraints and returns a list of errors tILookup-table which maps element names to their validation functions. The & validation functions are XmlFilters. > Perform the validation of the IDIDREFIDREFS constraints. - 1.parameter dtdPart : the DTD subset (Node DOCTYPE) of the XmlTree 7 2.parameter doc : the document subset of the XmlTree  returns : a list of errors u"Traverse the XmlTree in preorder. Z 1.parameter idEnv : lookup-table which maps element names to their validation functions  returns : list of errors vReturns the value of an element'-s ID attribute. The attribute name has to be  retrieved first from the DTD. F 1.parameter dtdPart : list of ID attribute definitions from the DTD F 2.parameter n : element which ID attribute value should be returned 0 returns : normalized value of the ID attribute wJBuild collector functions which return XTag nodes with ID attributes from  a document. , 1.parameter dtdPart : the children of the DOCTYPE node M returns : lookup-table which maps element names to their collector function x0Build validation functions for checking if IDREF/IDREFS values match a value  of some ID attributes. , 1.parameter dtdPart : the children of the DOCTYPE node E 2.parameter idNodeList : list of all XTag nodes with ID attributes N returns : lookup-table which maps element names to their validation function y:Validate that all ID values are unique within a document.  Validity constraint: ID (3.3.1 /p. 25 in Spec) E 1.parameter idNodeList : list of all XTag nodes with ID attributes , 2.parameter dtdPart : the children of the DOCTYPE node  returns : a list of errors zValidate that all IDREF/4IDREFS values match the value of some ID attribute. # Validity constraint: IDREF (3.3.1 / p.26 in Spec) \ 1.parameter idRefEnv : lookup-table which maps element names to their validation function - 2.parameter doc : the document to validate  returns : a list of errors {ILookup-table which maps element names to their validation functions. The & validation functions are XmlFilters. ?EMain validation filter. Check if the DTD and the document are valid. I returns : a function which expects a complete document as XmlTree input = and returns a list of all errors found. Check if the DTD is valid. H returns : a function which expects an XmlTree from the parser as input H and returns a list of all errors found in the DTD. 4Check if the document corresponds to the given DTD. I returns : a function which expects a complete document as XmlTree input Q and returns a list of all errors found in the content part. Bfilter for transforming a document with respect to the given DTD. Validating parsers E are expected to normalize attribute values and add default values. ? This function should be called after a successful validation. A returns : a function which expects a complete XML document tree 4 and returns the transformed XmlTree HRemoves doublicate declarations from the DTD which first declaration is @ binding. This is the case for ATTLIST and ENTITY declarations. L returns : A function that replaces the children of DOCTYPE nodes by a list < where all multiple declarations are removed. @Fmonadic filter for validating and transforming a wellformed document. the main function for validation. Mthe input tree must consist of a root node with a complete document and DTD. ` Result is the single element list containing same tree but tranformed with respect to the DTD, @ or, in case of errors, the root with an empty list of children A 7convenient function for reading a XML document without H dealing with state monads, error messages collection and other details getXmlDocument calls  A" with the list of parsing options , and an url or filename as document source. result is a triple = the resulting document tree with a root node containing all I meta info about the document (options, status info, http header, ...) ! the list of errors and warnings  the error level: one of c, d, e, f 'example for input (see also example in  A and example in  A)   main :: IO ()  main  = do 5 (res, errs, rc) <- getXmlDocument [] "test.xml"  if rc >= c_err  then issueErrors errs  else processTree res  " issueErrors :: XmlTrees -> IO ()  " processTree :: XmlTree -> IO () for options see  A,  is set implicitly  the inverse operation to  A :writes a complete document tree to a file, writing can be : controlled by options, the real work is done with filter  A. # useful options are the options of  A. Rresult is a pair: 1.part is a list of error messages, 2. part is the return code, % the status info of the write filter Rthis filter is useful, when processing XML in an arbitray context in the IO monad 4an example main program for such an application is:  main :: IO ()  main  = do > (input, readErrs, rc) <- getXmlDocument [...] "test.xml"  if rc >= c_err ! then issueErrors readErrs  else processTree input  ! processTree :: XmlTree -> IO ()  processTree t $ = let res = computeNewTree input  in do ? (writeErrs, rc2) <- putXmlDocument [...] "out.xml" res  if rc2 >= c_err % then issueErrors writeErrs  else return ()  " issueErrors :: XmlTrees -> IO ()  & computeNewTree :: XmlTree -> XmlTree  the main parsing filter ;this filter can be configured by an option list, a list of " option name, option value pairs. = the input tree must be a possibly empty document root tree. S all the options are stored as attributes in this root node to control processing. available options:  1: use HTML parser, else use XML parser (default)  5 : validate document (default), else skip validation  > : check namespaces, else skip namespace processing (default)  ? : canonicalize document (default), else skip canonicalization  M : preserve comments during canonicalization, else remove comments (default)  W : remove all whitespace, used for document indentation, else skip this step (default)  J : indent document by inserting whitespace, else skip this step (default)  Q : issue warnings, when parsing HTML (default), else ignore HTML parser warnings  N : issue all error messages on stderr (default), or ignore all error messages  Z : all error messages are collected during processing and appended to the result document 8 for further processing within the calling modules   : trace level: values: 0 -4  . : proxy for http access, e.g. www-cache:3128  M : for http access via external programm curl, default is native HTTP access  * : more options for external program curl   : the document source url   : default document encoding ( 2,  !,  0, ...)  examples:  * parseDocument [ (a_source, "test.xml") # , (a_validate, "0") ) , (a_encoding, isoLatin1)  ] emptyRoot reads document "test.xml") without validation and default encoding  !  ? parseDocument [ (a_source, "http://www.haskell.org/") ) , (a_parse_html, "1") 6 , (a_proxy, "www-cache:3128") ) , (a_curl, "1") ) , (a_issue_warnings, "0")  ] emptyRoot wreads Haskell homepage with HTML parser ignoring any warnings and with http access via external program curl and proxy " www-cache" at port 3128  > parseDocument [ (a_source, "http://www.w3c.org/") M , (a_parse_html, "0") -- default M , (a_validate, "1") -- default , , (a_check_namespace, "1") , , (a_remove_whitespace, "1") , , (a_trace, "2")  ] emptyRoot qread w3c home page, validate and chech namespaces, remove whitespace between tags, trace activities with level 2  * parseDocument [ (a_source, "test.xml") * , (a_validate, "1") * , (a_check_namespace, "1") * , (a_collect_errors, "1") * , (a_issue_errors, "0")  ] emptyRoot  reads file "test.xml"<, validates it, checks namespaces, does not issue any erros a but collects errors and appends the list of errors to the single element list for the document. D this enables the calling application to define own error handlers.  &the main filter for writing documents 5this filter can be configured by an option list like  A available options are  > : indent document for readability, (default: no indentation)  J : remove all redundant whitespace for shorten text (default: no removal)  - : destination file for document, default is "-" for stdout  $ : encoding of document, default is  or  2  0 : (default) issue XML: quote special XML chars >,<,",',& 3 add XML processing instruction 8 and encode document with respect to , X if explizitly switched of, the plain text is issued, this is useful V for non XML output, e.g. generated Haskell code, LaTex, Java, ...  8 : show tree representation of document (for debugging)  : : show Haskell representaion of document (for debugging)  ,  : see  A 5a typical main program running in the XmlState monad  has the following structure:   main :: IO ()  main  = do e argv <- getArgs -- get the commandline arguments r (inp, outp, options) <- cmdlineOpts argv -- and evaluate them, return a key-value list \ -- and input and output [ res <- run' $ application inp outp options $ emptyRoot -- run the application   exitWith (if null res ' then ExitFailure (-1) " else exitSuccess  )  D application :: String -> String -> Attributes -> XmlStateFilter ()  application inp outp al ^ = parseDocument (al ++ [(a_source, inp)]) -- set options and source Z .>> -- and parse document U processDocument -- the hard work  .>> U writeDocument [(a_output_file, outp)] -- issue results  .>> T checkStatus -- check errors  |,wrapper filter for running a monadic filter  controlled by common options 'input tree must be a complete document 9 parameters and default parameters can be used to contol 8 the filer and common tasks like error message handling         ~def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >      !"#$%&'()*+,-./0123456789:;<=>?@AUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./012349:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeghijklmnopqrstuvwxyz{|}~    Bm      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP   CXPath environment -All variables are stored in the environment, ) each variable name is bound to a value. AA functions that takes a XPath result and returns a XPath result 9Type synonym for a list of navigable tree representation /List of nodes of navigable tree representation  &Node of navigable tree representation !Represents XPath results ' Context node (Context length )Context position *Evaluation context +Function arguments ,Function name - a string .Variable name 2Represents nodetype-tests 7Represents XPath node-tests ;Represents XPath axis IRepresents location step NA location step consists of an axis, a node-test and zero or more predicates. K:A location path is either a relative or an absolute path. NRepresents location path FA location path consists of a sequence of one or more location steps. PCRepresents a floating-point number according the IEEE 754 standard :The standard includes a special Not-a-Number (NaN) value, = positive and negative infinity, positive and negative zero. WRepresents XPath operators gRepresents expression       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~D'Convert an navigable tree in a xmltree /Format a XPath-value in string representation.  Text output is done by # for node-sets (trees), . all other values are represented as strings. 'Convert a a XPath-value into XmlTrees. 9Format a parsed XPath-expression in tree representation.  Text output is done by # EUnary minus: the value UC- is not calculatable and returned unchanged, ! all other values can be denied. Multiplication Modulo GDivision: the divison-operator is not according the IEEE 754 standard, A it calculates the same as the % operator in Java and ECMAScript Plus and minus *1.parameter op : plus or minus operation }9Identically results of the operators are combined to get < as few as possible combinations of the special IEEE values F$Start of a context attribute value  (see also: 7Text.XML.HXT.RelaxNG.Simplification.simplificationStep1) FThe value is always followed by the original attribute name and value #Start of base uri attribute value  (see also: simplificationStep1 in #Text.XML.HXT.RelaxNG.Simplification) !smart constructor for NotAllowed merge error messages <If error levels are different, the more important is taken, 9 if level is 2 (max level) both error messages are taken # else the 1. error mesage is taken smart constructor for Choice smart constructor for Group  smart constructor for OneOrMore !smart constructor for Interleave smart constructor for After .Possible content types of a Relax NG pattern. 2 (see also chapter 7.2 in Relax NG specification) *Represents a pattern after simplification Represents a name class NA Datatype identifies a datatype by a datatype library name and a local name. 5A Context represents the context of an XML element. J It consists of a base URI and a mapping from prefixes to namespace URIs. UList of parameters; each parameter is a pair consisting of a local name and a value. GThe Constructor exports the list of supported datatypes for a library. I It also exports the specialized datatype library functions to validate 2 a XML instance value with respect to a datatype. 8function to test whether a value matches a data-pattern 9function to test whether a value matches a value-pattern ,list of all supported params for a datatype 9List of all supported datatypes and there allowed params ,List of all supported params for a datatype .Each datatype library is identified by a URI. )List of all supported datatype libraries =Type of all datatype libraries functions that tests whether . a XML instance value matches a data-pattern.  Returns Just " errorMessage"# in case of an error else Nothing. =Type of all datatype libraries functions that tests whether / a XML instance value matches a value-pattern.  Returns Just " errorMessage"# in case of an error else Nothing. I ~      ,G6Returns a list of children pattern for each pattern,  e.g. (Choice p1 p2) = [p1, p2] :Returns the nameclass of a element- or attribute pattern.  Otherwise   is returned. 4Returns a string representation of the pattern name H "Function table for numeric tests, : XML document value is first operand, schema value second !Function table for string tests, : XML document value is first operand, schema value second 5tests whether a string value matches a numeric param valid example:  > <data type="CHAR"> <param name="maxLength">5</param> </data> invalid example: @ <data type="CHAR"> <param name="minLength">foo</param> </data>  Unit for checks >Zero for checks: Create an error message for an illegal value 4Perform check and generate error message on failure Combine two checks Tests whether a "string"* datatype value is between the lower and 8upper bound of the datatype and matches all parameters. -All tests are performed on the string value.  1.parameter : datatype 3 2.parameter : lower bound of the datatype range J 3.parameter : upper bound of the datatype range (-1 = no upper bound) $ 4.parameter : list of parameters . 5.parameter : datatype value to be checked  return : Just " Errormessage"# in case of an error, else Nothing Tests whether a "numeric"0 datatype value is between the lower and upper 2bound of the datatype and matches all parameters. AFirst, the string value is parsed into a numeric representation. KIf no error occur, all following tests are performed on the numeric value.  1.parameter : datatype 3 2.parameter : lower bound of the datatype range J 3.parameter : upper bound of the datatype range (-1 = no upper bound) $ 4.parameter : list of parameters . 5.parameter : datatype value to be checked  return : Just " Errormessage"# in case of an error, else Nothing ;Error Message for the equality test of two datatype values  1.parameter : datatype  2.parameter : datatype value  3.parameter : datatype value  example: ` errorMsgEqual "Int" "21" "42" -> "Datatype Int with value = 21 expected, but value = 42 found" Function table type qrstuvwxyz{|}~ ~                Iportable experimentalUwe Schmidt (uwe@fh-wedel.de)1Namespace of the W3C XML schema datatype library #=The main entry point to the W3C XML schema datatype library. The  A constructor exports the list of supported datatypes and params. Q It also exports the specialized functions to validate a XML instance value with  respect to a datatype. 'All supported datatypes of the library 0List of allowed params for the string datatypes ;Tests whether a XML instance value matches a data-pattern.  (see also: H) <Tests whether a XML instance value matches a value-pattern.  !"# # !"Jportable experimentalUwe Schmidt (uwe@fh-wedel.de)$-test: is schema a simple XML Schema datatype %+test: is type a fixed value attribute type .1access an attribute of a descr of an atomic type J/The datatype for modelling the structure of an 6$%&'()*+,-./0123456789:;<=>?@ABCD EFGHIJ K L MNO P -$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPKportable experimentalUwe Schmidt (uwe@fh-wedel.de)Q"convert a DTD descr into XmlTrees ]*convert a pickler schema into a DTD descr QRSTUVWXYZ[\]^_`abcde QRSTUVWXYZ[\]^_`abcdeL f(Namespace of the MySQL datatype library g4The main entry point to the MySQL datatype library. The  A constructor exports the list of supported datatypes and params. Q It also exports the specialized functions to validate a XML instance value with  respect to a datatype. 'All supported datatypes of the library #List of supported string datatypes $List of supported numeric datatypes 1List of allowed params for the numeric datatypes 0List of allowed params for the string datatypes ;Tests whether a XML instance value matches a data-pattern. <Tests whether a XML instance value matches a value-pattern. fgfgMh7List of all supported datatype libraries which can be + used within the Relax NG validator modul. i<Tests whether a XML instance value matches a value-pattern. #The following tests are performed: F 1. : does the uri exist in the list of supported datatype libraries - 2. : does the library support the datatype ; 3. : does the XML instance value match the value-pattern )The hard work is done by the specialized F function  (see also: F) of the datatype library. j;Tests whether a XML instance value matches a data-pattern. #The following tests are performed: F 1. : does the uri exist in the list of supported datatype libraries - 2. : does the library support the datatype : 3. : does the XML instance value match the data-pattern 4 4. : does the XML instance value match all params )The hard work is done by the specialized F function  (see also: F) of the datatype library. Cif there is no datatype uri, the build in datatype library is used QThe build in Relax NG datatype lib supportes only the token and string datatype,  without any params. @If the token datatype is used, the values have to be normalized 1 (trailing and leading whitespaces are removed). 3 token does not perform any changes to the values. hijhijNportable experimentalUwe Schmidt (uwe@fh-wedel.de)k)parsing a number, parseNumber is used in XPathFct  by the number function  returns : the parsed number as PC float  or $C UC in case of error lthe main entry point:  parsing a XPath expression klklOmJConvert a a XPath-value into a XmlNodeSet represented by a tree structure =The XmlNodeSet can be used to traverse a tree an process all  marked nodes. mnmnPportable experimentalUwe Schmidt (uwe\@fh-wedel.de)o-complete evaluation of an arrow result using   and  Nthis is sometimes useful for preventing space leaks, especially after reading M and validation of a document, all DTD stuff is not longer in use and can be  recycled by the GC. ooQportable experimentalUwe Schmidt (uwe\@fh-wedel.de)p>The interface for accessing and changing the state component. BMulti parameter classes and functional dependencies are required. q9change the state of a state arrow by applying a function = for computing a new state from the old and the arrow input.  Result is the arrow input r7access the state with a function using the arrow input ) as data for selecting state components. s,read the complete state, ignore arrow input  definition:  getState = accessState (\ s x -> s)  toverwrite the old state  definition:  setState = changeState (\ s x -> x)  u5change state (and ignore input) and return new state convenience function, 1 usefull for generating e.g. unique identifiers: #example with SLA state list arrows  newId :: SLA Int b String  newId = nextState (+1)  >>>  arr (('#':) . show)  0 runSLA 0 (newId <+> newId <+> newId) undefined  = ["#1", "#2", "#3"] pqrstupqrstuRportable experimentalUwe Schmidt (uwe\@fh-wedel.de)vThe interface for list arrows Only mkA, zR, R '(>>.)' don't have default implementations w:construction of a 2 argument arrow from a binary function  |  | example:  a1 &&& a2 >>> arr2 f  x9construction of a 3 argument arrow from a 3-ary function  |  | example:  a1 &&& a2 &&& a3 >>> arr3 f  y9construction of a 4 argument arrow from a 4-ary function  |  | example:  a1 &&& a2 &&& a3 &&& a4 >>> arr4 f  z?construction of a 2 argument arrow from a singe argument arrow {Cconstructor for a list arrow from a function with a list as result |.constructor for a list arrow with 2 arguments }constructor for a const arrow:  constA = arr . const  ~constructor for a const arrow:  constL = arrL . const  "builds an arrow from a predicate. _ If the predicate holds, the single list containing the input is returned, else the empty list Gcombinator for converting the result of a list arrow into another list  example:  foo >>. reverse  reverses the the result of foo  example:  foo >>. take 1 K constructs a deterministic version of foo by deleting all further results Ncombinator for converting the result of an arrow into a single element result scombinator for converting an arrow into a determinstic version with all results collected in a single element list   listA af = af >>. (:[])_this is useful when the list of results computed by an arrow must be manipulated (e.g. sorted) ,example for sorting the results of a filter * collectAndSort :: a b c -> a b c  6 collectAndSort collect = listA collect >>> arrL sort &the identity arrow, alias for returnA $the zero arrow, alias for zeroArrow Econverts an arrow, that may fail, into an arrow that always succeeds  example:  withDefault none "abc"  is equivalent to  constA "abc"  Emakes a list arrow deterministic, the number of results is at most 1  definition   single f = f >>. take 1 examples with strings: ! runLA ( single none ) "x" == [] $ runLA ( single this ) "x" == ["x"]  runLA ( single  (constA "y" $ <+> this ) ) "x" == ["y"] Bcompute an arrow from the input and apply the arrow to this input  definition:  (f &&& this) >>> app  Gin a point free style, there is no way to use an argument in 2 places, [ this is a combinator for simulating this. first the argument is used to compute an arrow, - then this new arrow is applied to the input applyA coresponds to:  apply f x = let g = f x in g x   see also: R, R, R, R, R Hcompute the parameter for an arrow with extra parameters from the input ; and apply the arrow for all parameter values to the input  a kind of " function call"' for arrows, useful for joining arrows   infixl 2 ($<)  definition:   g $< f = applyA (f >>> arr g) if f$ fails, the whole arrow fails, e.g.  g $< none == none  if f computes n values and g5 is deterministic, the whole arrow computes n values .examples with simple list arrows with strings  - prefixString :: String -> a String String  prefixString s = arr (s++)  4 runLA ( prefixString $< none ) "x" == [] 8 runLA ( prefixString $< constA "y" ) "x" == ["yx"] 8 runLA ( prefixString $< this ) "x" == ["xx"] $ runLA ( prefixString $< constA "y" = <+> constA "z" ) "x" == ["yx","zx"] $ runLA ( prefixString $< constA "y" " <+> this B <+> constA "z" ) "x" == ["yx","xx","zx"]  see also: R, R, R, R, R binary version of R -example with simple list arrows with strings 7 infixString :: String -> String -> a String String  infixString s1 s2 - = arr (\ s -> s1 ++ s ++ s2)  C runLA ( infixString $<< constA "y" &&& constA "z" ) "x" = ["yxz"] C runLA ( infixString $<< this &&& this ) "x" = ["xxx"] $ runLA ( infixString $<< constA "y" J &&& (constA "z" <+> this) ) "x" = ["yxz", "yxx"]  version of R$ for arrows with 3 extra parameters typical usage  f $<<< g1 &&& g2 &&& g3  version of R$ for arrows with 4 extra parameters typical usage ! f $<<<< g1 &&& g2 &&& g3 &&& g4 #compute the parameter for an arrow f% with an extra parameter by an arrow g  and apply all the results from g sequentially to the input   infixl 2 ($<$) typical usage:   g :: a b c  g = ...   f :: c -> a b b  f x = ... x ...   f $<$ g f# computes the extra parameters for g from the input of type b and g is applied with this J parameter to the input. This allows programming in a point wise style in g, which becomes 4 neccessary, when a value is needed more than once. Uthis combinator is useful, when transforming a single value (document) step by step,  with g, for collecting the data for all steps, and f) for transforming the input step by step if g1 is deterministic (computes exactly one result),   g $< $ f == g $< f  holds if g fails,  f $< $ g == this  if g computes more than one result, f< is applied sequentially to the input for every result from g .examples with simple list arrows with strings  - prefixString :: String -> a String String  prefixString s = arr (s++)  C runLA ( prefixString $<$ none ) "x" == ["x"] D runLA ( prefixString $<$ constA "y" ) "x" == ["yx"] E runLA ( prefixString $<$ constA "y" <+> constA "z" ) "x" == ["zyx"] . runLA ( prefixString $<$ constA "y" <+> this F <+> constA "z" ) "x" == ["zxyx"] !example with two extra parameter   g1 :: a b c1  g2 :: a b c2  ! f :: (c1, c2) -> a b b " f (x1, x2) = ... x1 ... x2 ...   f $<$ g1 &&& g2  see also: R, R Puseful only for arrows with side effects: perform applies an arrow to the input * ignores the result and returns the input  example: ( ... >>> perform someTraceArrow >>> ...  #generalization of arrow combinator  y  definition:  catA = foldl ( +) none  #generalization of arrow combinator  y  definition:  seqA = foldl (>>>) this  vwxyz{|}~vwxyz{|}~Sportable experimentalUwe Schmidt (uwe\@fh-wedel.de)an auxiliary data type for S *The interface for arrows as conditionals. [Requires list arrows because False is represented as empty list, True as none empty lists. Only S and S don't have default implementations if lifted to arrows  shortcut:  ifP p = ifA (isA p)   negation:  neg f = ifA f none this   f `when` g K : when the predicate g holds, f is applied, else the identity filter this  shortcut:  f `whenP` p = f `when` (isA p)   f `whenNot` g S : when the predicate g does not hold, f is applied, else the identity filter this like S  g `guards` f 7 : when the predicate g holds, f is applied, else none like S  f ` containing` g 4 : keep only those results from f for which g holds  definition:  f ` containing` g = f >>> g `guards` this   f ` notContaining` g < : keep only those results from f for which g does not hold  definition:  f ` notContaining` g = f >>> ifA g none this   f `orElse` g W : directional choice: if f succeeds, the result of f is the result, else g is applied generalisation of S2 for multi way branches like in case expressions. An auxiliary data type S with an infix constructor ':->'( is used for writing multi way branches  example: 2 choiceA [ p1 :-> e1, p2 :-> e2, this :-> default ]  atag a value with Left or Right, if arrow has success, input is tagged with Left, else with Right >split a list value with an arrow and returns a pair of lists.  This is the arrow version of  y. The arrow is deterministic.  example:  runLA (spanA (isA (/= '-'))) "abc-def"  gives  [("abc","-def")]  as result 0partition a list of values into a pair of lists This is the arrow Version of  y &Tportable experimentalUwe Schmidt (uwe\@fh-wedel.de)The interface for tree arrows +all functions have default implementations *select the children of the root of a tree +select the attribute of the root of a tree .substitute the children of the root of a tree /substitute the attribute of the root of a tree (edit the children of the root of a tree )edit the attribute of the root of a tree Bapply an arrow element wise to all children of the root of a tree D collect these results and substitute the children with this result  example:  processChildren isText 6 deletes all subtrees, for which isText does not hold  example:  processChildren (none `when` isCmt) - removes all children, for which isCmt holds Lsimilar to processChildren, but the new children are computed by processing  the whole input tree  example:  replaceChildren (deep isText) - selects all subtrees for which isText holds H and substitutes the children component of the root node with this list  pronounced "slash", meaning g inside f  defined as  f /> g = f >>> getChildren >>> g   example:  hasName "html" / > hasName "body" / > hasName "h1"  This expression selects  all "h1" elements in the "body" element of an "html" element, an expression, that - corresponds 1-1 to the XPath selection path "html/body/h1"  pronounced "outside" meaning f containing g  defined as  f </ g = f ` containing` (getChildren >>> g)  Mrecursively searches a whole tree for subtrees, for which a predicate holds. _ The search is performed top down. When a tree is found, this becomes an element of the result i list. The tree found is not further examined for any subtress, for which the predicate also could hold.  See T for this kind of search.  example:  deep isHtmlTable 4 selects all top level table elements in a document ^ (with an appropriate definition for isHtmlTable) but no tables occuring within a table cell. Lrecursively searches a whole tree for subrees, for which a predicate holds. $ The search is performed bottom up.  example:  deepest isHtmlTable 4 selects all innermost table elements in a document . but no table elements containing tables. See T and T for other search strategies. Mrecursively searches a whole tree for subtrees, for which a predicate holds. W The search is performed top down. All nodes of the tree are searched, even within the 2 subtrees of trees for which the predicate holds.  example:  multy isHtmlTable / selects all table elements, even nested ones. Jrecursively transforms a whole tree by applying an arrow to all subtrees, E this is done bottom up depth first, leaves first, root as last tree  example:  processBottomUp (getChildren `when` isHtmlFont) < removes all font tags in a HTML document, even nested ones 0 (with an appropriate definition of isHtmlFont)  similar to TO, but recursively transforms a whole tree by applying an arrow to all subtrees @ with a top down depth first traversal strategie. In many cases T and T  give same results. Jrecursively transforms a whole tree by applying an arrow to all subtrees, G but transformation stops when a predicte does not hold for a subtree,  leaves are transformed first Jrecursively transforms a whole tree by applying an arrow to all subtrees, C but transformation stops when a tree is successfully transformed. % the transformation is done top down  example: " processTopDownUntil (isHtmlTable `guards` tranformTable)  ` transforms all top level table elements into something else, but inner tables remain unchanged ;computes a list of trees by applying an arrow to the input C and inserts this list in front of index i in the list of children  example: ! insertChildrenAt 0 (deep isCmt) , selects all subtrees for which isCmt holds 5 and copies theses in front of the existing children  similar to T:, but the insertion position is searched with a predicate Jan arrow for inserting a whole subtree with some holes in it (a template) H into a document. The holes can be filled with contents from the input. Example  5 insertTreeTemplateTest :: ArrowXml a => a b XmlTree  insertTreeTemplateTest  = doc  >>> ' insertTemplate template pattern  where " doc -- the input data 7 = constA "<x><y>The Title</y><z>The content</z></x>"  >>> xread F template -- the output template with 2 holes: xxx and yyy S = constA "<html><head><title>xxx</title></head><body><h1>yyy</h1></body></html>"  >>> xread  pattern ^ = [ hasText (== "xxx") -- fill the xxx hole with the input contents from element "x/y" : :-> ( getChildren >>> hasName "y" >>> deep isText )  ^ , hasText (== "yyy") -- fill the yyy hole with the input contents from element "x/z" : :-> ( getChildren >>> hasName "z" >>> getChildren )  ] 1computes the XML tree for the following document W "<html><head><title>The Title</title></head><body><h1>The content</h1></body></html>" Uportable experimentalUwe Schmidt (uwe\@fh-wedel.de)@conversion of pure list arrows into other possibly more complex  list arrows pure list arrow data type Vportable experimentalUwe Schmidt (uwe\@fh-wedel.de)4conversion of state list arrows into arbitray other  list arrows. 8allows running a state list arrow within another arrow:  example:  < ... >>> fromSLA 0 (... setState ... getState ... ) >>> ... >runs a state arrow with initial state 0 (e..g. an Int) within  another arrow sequence !list arrow combined with a state Wportable experimentalUwe Schmidt (uwe\@fh-wedel.de)?the interface for converting an IO predicate into a list arrow %builds an arrow from an IO predicate _if the predicate holds, the single list containing the input is returned, else the empty list,  similar to Control.Arrow.ArrowList.isA 8the interface for converting an IO action into an arrow %construct an arrow from an IO action ;construct an arrow from an IO action without any parameter ;construction of a 2 argument arrow from a binary IO action  |  | example:  a1 &&& a2 >>> arr2 f  :construction of a 3 argument arrow from a 3-ary IO action  |  | example:  a1 &&& a2 &&& a3 >>> arr3 f  :construction of a 4 argument arrow from a 4-ary IO action  |  | example:  a1 &&& a2 &&& a3 &&& a4 >>> arr4 f  Xportable experimentalUwe Schmidt (uwe\@fh-wedel.de)"list arrow combined with IO monad Yportable experimentalUwe Schmidt (uwe\@fh-wedel.de)Jlift the state of an IOSLA arrow to a state with an additional component. LThis is uesful, when running predefined IO arrows, e.g. for document input, 3 in a context with a more complex state component. Jrun an arrow with augmented state in the context of a simple state arrow. 9 An initial value for the new state component is needed. PThis is useful, when running an arrow with an extra environment component, e.g.  for namespace handling in XML. 2list arrow combined with a state and the IO monad Zportable experimentalUwe Schmidt (uwe@fh-wedel.de)c Document Type Definition arrows JThese are separated, because they are not needed for document processing, Ronly when processing the DTD, e.g. for generating access funtions for the toolbox ?from a DTD (se example DTDtoHaskell in the examples directory) Arrows for processing s XThese arrows can be grouped into predicates, selectors, constructors, and transformers.  All predicates (tests) act like Control.Arrow.ArrowIf.none for failure and Control.Arrow.ArrowIf.this for success. A logical and can be formed by  a1 >>> a2 , a locical or by  a1 <+> a2 . _Selector arrows will fail, when applied to wrong input, e.g. selecting the text of a node with *Z ,will fail when applied to a none text node. uEdit arrows will remain the input unchanged, when applied to wrong argument, e.g. editing the content of a text node with CZD applied to an element node will return the unchanged element node. test for text nodes -test for char reference, used during parsing /test for entity reference, used during parsing test for comment ,test for CDATA section, used during parsing  test for processing instruction  test for processing instruction <?xml ...> test for element 'test for DTD part, used during parsing test for attribute tree test for error message &test for root node (element with name "/") ;test for text nodes with text, for which a predicate holds  example: hasText (all (`elem` " \t\n"))3 check for text nodes with only whitespace content *test for text nodes with only white space implemented with hasTest Ptest whether a node (element, attribute, pi) has a name with a special property Ktest whether a node (element, attribute, pi) has a specific qualified name ) useful only after namespace propagation Jtest whether a node has a specific name (prefix:localPart ore localPart), 3 generally useful, even without namespace handling 7test whether a node has a specific name as local part, ) useful only after namespace propagation  0test whether a node has a specific name prefix, ) useful only after namespace propagation  1test whether a node has a specific namespace URI ) useful only after namespace propagation  Htest whether an element node has an attribute node with a specific name  Rtest whether an element node has an attribute node with a specific qualified name  Dtest whether an element node has an attribute with a specific value Ytest whether an element node has an attribute with a qualified name and a specific value text node construction arrow >char reference construction arrow, useful for document output @entity reference construction arrow, useful for document output 6comment node construction, useful for document output /CDATA construction, useful for document output 0error node construction, useful only internally element construction: Q | the attributes and the content of the element are computed by applying arrows  to the input attribute node construction: E | the attribute value is computed by applying an arrow to the input %processing instruction construction: [ | the content of the processing instruction is computed by applying an arrow to the input Gconvenient arrow for element construction, more comfortable variant of Z example for simplifying Z :  6 mkElement qn (a1 <+> ... <+> ai) (c1 <+> ... <+> cj) equals $ mkqelem qn [a1,...,ai] [c1,...,cj] hconvenient arrow for element construction with strings instead of qualified names as tagnames, see also Z and Z `convenient arrow for element constrution with attributes but without content, simple variant of Z and Z Vconvenient arrow for simple element constrution without attributes, simple variant of Z and Z Yconvenient arrow for constrution of empty elements without attributes, simple variant of Z and Z *construction of an element node with name "/" for document roots  alias for Z >convenient arrow for attribute constrution, simple variant of Z  constant arrow for text nodes !(constant arrow for char reference nodes "*constant arrow for entity reference nodes #constant arrow for comment $constant arrow for warning %constant arrow for errors & constant arrow for fatal errors '7constant arrow for simple processing instructions, see Z (\constant arrow for attribute nodes, attribute name is a qualified name and value is a text,  | see also Z, Z, Z )Aconstant arrow for attribute nodes, attribute name and value are  | given by parameters, see Z *select the text of a text node +%select the value of a char reference ,+select the name of a entity reference node -%select the comment of a comment node .#select the content of a CDATA node /,select the name of a processing instruction 0/select the content of a processing instruction 1#select the name of an element node 2-select the attribute list of an element node 3"select the DTD type of a DTD node 4(select the DTD attributes of a DTD node 5 select the name of an attribute 6Cselect the error level (c_warn, c_err, c_fatal) from an error node 7,select the error message from an error node 8;select the qualified name from an element, attribute or pi 9Jselect the prefix:localPart or localPart from an element, attribute or pi :8select the univeral name ({namespace URI} ++ localPart) ;6select the univeral name (namespace URI ++ localPart) <select the local part =select the name prefix >select the namespace URI ?5select the value of an attribute of an element node, 4 always succeeds with empty string as default value "" @like ?Z,, but fails if the attribute does not exist Alike ?ZB, but select the value of an attribute given by a qualified name, 4 always succeeds with empty string as default value "" Blike AZ(, but fails if attribute does not exist Cedit the string of a text node D*edit the comment string of a comment node E)edit an element-, attribute- or pi- name Fedit an element name Gedit an attribute name Hedit a pi name Iedit an attribute value J*edit an attribute list of an element node K)replace an element, attribute or pi name Lreplace an element name Mreplace an attribute name Nreplace an element name O,replace an atribute list of an element node P,add a list of attributes list to an element Qadd (or replace) an attribute Rremove an attribute S*remove an attribute with a qualified name T8process the attributes of an element node with an arrow U?process a whole tree inclusive attribute list of element nodes  see also: T V:convenient op for adding attributes or children to a node usage:  tf += cf  the tf; arrow computes an element node, and all trees computed by cf are U added to this node, if a tree is an attribute, it is inserted in the attribute list * else it is appended to the content list. ;attention: do not build long content list this way because VZ is implemented by ++  examples:   eelem "a"  += sattr "href" "page.html"  += sattr "name" "here"  += txt "look here" is the same as  # mkelem [ sattr "href" "page.html"  , sattr "name" "here"  ]  [ txt "look here" ] !and results in the XML fragment: <a href=" page.html" name="here"> look here</a> advantage of the VZ7 operator is, that attributes and content can be added  any time step by step.  if tf0 computes a whole list of trees, e.g. a list of "td" or "tr" elements, D the attributes or content is added to all trees. useful for adding "class" or "style" attributes  to table elements. W]apply an arrow to the input and convert the resulting XML trees into a string representation u      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~[portable experimentalUwe Schmidt (uwe@fh-wedel.de)  Applies some  Canonical XML rules to a document tree. MThe rule differ slightly for canonical XML and XPath in handling of comments KNote: This is not the whole canonicalization as it is specified by the W3C R Recommendation. Adding attribute defaults or sorting attributes in lexicographic  order is done by the  transform function of module !Text.XML.HXT.Validator.Validation. F Replacing entities or line feed normalization is done by the parser. Not implemented yet: 4 Whitespace within start and end tags is normalized c Special characters in attribute values and character content are replaced by character references see [ and [  Applies some  Canonical XML rules to a document tree. MThe rule differ slightly for canonical XML and XPath in handling of comments KNote: This is not the whole canonicalization as it is specified by the W3C R Recommendation. Adding attribute defaults or sorting attributes in lexicographic  order is done by the  transform function of module !Text.XML.HXT.Validator.Validation. F Replacing entities or line feed normalization is done by the parser. aRules: remove DTD parts, processing instructions, comments and substitute char refs in attribute  values and text Not implemented yet: 4 Whitespace within start and end tags is normalized c Special characters in attribute values and character content are replaced by character references Canonicalize a tree for XPath  Like [# but comment nodes are not removed see [ (Canonicalize the contents of a document 8substitutes all char refs in text and attribute values, D removes CDATA section and combines all sequences of resulting text  nodes into a single text node see [ ^Collects sequences of text nodes in the list of children of a node into one single text node. C This is useful, e.g. after char and entity reference substitution #Applies collapseXText recursively.  see also : [ Kescape all special XML chars into XML entity references or char references convert the special XML chars < and &7 in text nodes into prefefiened XML entity references,  in attribute values also ', ", >, \n, \r and \0t are converted into entity or char references, V in comments nothing is converted (see XML standard 2.4, useful e.g. for JavaScript). Nescape all special HTML chars into XHTML entity references or char references convert the special XML chars < and &Y and all none ASCII chars in text nodes into prefefiened XML or XHTML entity references,  in attribute values also ', ", >, \n, \r and \0t are converted into entity or char references, " in comments nothing is converted >convert a document into a Haskell representation (with show). 'Useful for debugging and trace output.  see also : [, [ Pconvert a document into a text and add line numbers to the text representation. 8Result is a root node with a single text node as child. ( Useful for debugging and trace output.  see also : [, [ <convert a document into a text representation in tree form. 'Useful for debugging and trace output.  see also : [, [ remove Comments: none S isCmt  remove all comments recursively 'simple filter for removing whitespace. 0no check on sigificant whitespace, e.g. in HTML <pre>-elements, is done.  see also : [, [ 5simple recursive filter for removing all whitespace. Bremoves all text nodes in a tree that consist only of whitespace.  see also : [, [ 4filter for removing all not significant whitespace. =the tree traversed for removing whitespace between elements, 4 that was inserted for indentation and readability. / whitespace is only removed at places, where it's not significat < preserving whitespace may be controlled in a document tree  by a tag attribute  xml:space &allowed values for this attribute are default | preserve 5input is root node of the document to be cleaned up, 4 output the semantically equivalent simplified tree  see also : [, [ :filter for indenting a document tree for pretty printing. Dthe tree is traversed for inserting whitespace for tag indentation. >whitespace is only inserted or changed at places, where it isn't significant,  is'Fs not inserted between tags and text containing non whitespace chars. :whitespace is only inserted or changed at places, where it's not significant. < preserving whitespace may be controlled in a document tree  by a tag attribute  xml:space &allowed values for this attribute are default | preserve. 9input is a complete document tree or a document fragment 7 result is the semantically equivalent formatted tree.  see also : [ 6converts a CDATA section node into a normal text node Fconverts CDATA sections in whole document tree into normal text nodes -converts character references to normal text =recursively converts all character references to normal text add an < ?xml version="1.0"?> processing instruction  if it's not already there add an encoding spec to the < ?xml version="1.0"?> processing instruction 6add an XHTML strict doctype declaration to a document 6add an XHTML strict doctype declaration to a document <add an XHTML transitional doctype declaration to a document 8add an XHTML frameset doctype declaration to a document (add a doctype declaration to a document IThe arguments are the root element name, the PUBLIC id and the SYSTEM id escape XmlText, = transform all special XML chars into char- or enitity- refs \portable experimentalUwe Schmidt (uwe@fh-wedel.de)Etest whether an attribute node contains an XML Namespace declaration 6get the namespace prefix and the namespace URI out of 5 an attribute tree with a namespace declaration (see \) & for all other nodes this arrow fails ;collect all namespace declarations contained in a document apply \ to a whole XmlTree 9collect all (namePrefix, namespaceUri) pairs from a tree Gall qualified names are inspected, whether a namespace uri is defined, I for these uris the prefix and uri is returned. This arrow is useful for K namespace cleanup, e.g. for documents generated with XSLT. It can be used  together with \ to \ Rgenerate unique namespaces and add all namespace declarations to the root element Calls \ with \ ngenerate unique namespaces and add all namespace declarations for all prefix-uri pairs in all qualified names 9useful for cleanup of namespaces in generated documents.  Calls \ with  collectNamespaceDecl  + collectPrefixUriPairs  *does the real work for namespace cleanup. UThe parameter is used for collecting namespace uris and prefixes from the input tree <auxiliary arrow for processing with a namespace environment =process a document tree with an arrow, containing always the 1 valid namespace environment as extra parameter. / The namespace environment is implemented as a Data.AssocList.AssocList. C Processing of attributes can be controlled by a boolean parameter =process a document tree with an arrow, containing always the 1 valid namespace environment as extra parameter. .The namespace environment is implemented as a Data.AssocList.AssocList Rprocess all element nodes of a document tree with an arrow, containing always the T valid namespace environment as extra parameter. Attribute lists are not processed.  See also: \ Pattach all valid namespace declarations to the attribute list of element nodes. TThis arrow is useful for document processing, that requires access to all namespace J declarations at any element node, but which cannot be done with a simple \. %propagate all namespace declarations " xmlns:ns=..."3 to all element and attribute nodes of a document. 9This arrow does not check for illegal use of namespaces.  The real work is done by  . 3The arrow may be applied repeatedly if neccessary. 9attaches the namespace info given by the namespace table 0 to a tag node and its attributes and children. 4validate the namespace constraints in a whole tree. 4Result is the list of errors concerning namespaces.  Predicates , , isDeclaredNamespaces  and 9 are applied to the appropriate elements and attributes. (a single node for namespace constrains.  ]Csubstitution of all predefined XHTMT entities for none ASCII chars AThis arrow recurses through a whole XML tree and substitutes all C entity refs within text nodes and attribute values by a text node ; containing of a single char corresponding to this entity. %Unknown entity refs remain unchanged =substitution of the five predefined XMT entities, works like ] *the entity substitution arrow called from ] and ]           portable experimentalUwe Schmidt (uwe\@fh-wedel.de) opqrstuvwxyz{|}~^portable experimentalUwe Schmidt (uwe@fh-wedel.de)<conversion of an arbitrary value into an XML document tree. ?The pickler, first parameter, controls the conversion process. : Result is a complete document tree including a root node ?Conversion of an XML document tree into an arbitrary data type The inverse of ^. ( This law should hold for all picklers: ' unpickle px . pickle px $ v == Just v . 8 Not every possible combination of picklers make sense. C For reconverting a value from an XML tree, is becomes neccessary,  to introduce "enough"! markup for unpickling the value The zero pickler 0Encodes nothing, fails always during unpickling !Lift a value to a pickler QWhen pickling, nothing is encoded, when unpickling, the given value is inserted.  This pickler always succeeds. "!Lift a Maybe value to a pickler. Nothing is mapped to the zero pickler, Just x is pickled with xpLift x. #pickle/-unpickle combinator for sequence and choice.  When the first unpickler fails, W the second one is taken, else the third one configured with the result from the first 0 is taken. This pickler is a generalisation for $^ and %^ . TThe schema must be attached later, e.g. in xpPair or other higher level combinators $#Combine two picklers sequentially. If the first fails during ' unpickling, the whole unpickler fails %#combine tow picklers with a choice .Run two picklers in sequence like with xpSeq. - When during unpickling the first one fails, 5 an alternative pickler (first argument) is applied. 9 This pickler only is used as combinator for unpickling. &6map value into another domain and apply pickler there %One of the most often used picklers. 'like &^?, but if the inverse mapping is undefined, the unpickler fails ;Map a value into another domain. If the inverse mapping is * undefined (Nothing), the unpickler fails (%pickle a pair of values sequentially 2Used for pairs or together with wrap for pickling * algebraic data types with two components )Like (^ but for triples *Like (^ and )^ but for 4-tuples +Like (^ and )^ but for 5-tuples ,&Pickle a string into an XML text node :One of the most often used primitive picklers. Attention:  For pickling empty strings use .^. If the text has a more ( specific datatype than xsd:string, use -^ -&Pickle a string into an XML text node =Text pickler with a description of the structure of the text 9 by a schema. A schema for a data type can be defined by /J.  In  Text.XML.HXT.Arrow.Pickle.Schema, there are some more functions for creating  simple datatype descriptions. .1Pickle a possibly empty string into an XML node. BMust be used in all places, where empty strings are legal values. L If the content of an element can be an empty string, this string disapears B during storing the DOM into a document and reparse the document. W So the empty text node becomes nothing, and the pickler must deliver an empty string, + if there is no text node in the document. /MPickle a possibly empty string with a datatype description into an XML node. Like .^9 but with extra Parameter for datatype description as in -^. 0<Pickle an arbitrary value by applyling show during pickling  and read during unpickling.  Real pickling is then done with xpString. B One of the most often used pimitive picklers. Applicable for all  types which are instances of Read and Show 1$Pickle an XmlTree by just adding it @Usefull for components of type XmlTree in other data structures 2GEncoding of optional data by ignoring the Nothing case during pickling H and relying on failure during unpickling to recompute the Nothing case $The default pickler for Maybe types 3DEncoding of list values by pickling all list elements sequentially. ?Unpickler relies on failure for detecting the end of the list. F The standard pickler for lists. Can also be used in combination with &^ ' for constructing set and map picklers 4(Encoding of a none empty list of values 9Attention: when calling this pickler with an empty list,  an internal error "head of empty list is raised". 5Pickler for sum data types. CEvery constructor is mapped to an index into the list of picklers. \ The index is used only during pickling, not during unpickling, there the 1. match is taken 6Pickler for wrapping/$unwrapping data into an XML element BExtra parameter is the element name. THE pickler for constructing  nested structures 7Pickler for storing/retreiving data into/from an attribute value HThe attribute is inserted in the surrounding element constructed by the 6^ pickler 8;Add an optional attribute for an optional value (Maybe a). :%Add an attribute with a fixed value. 5Useful e.g. to declare namespaces. Is implemented by 9^ ;The class for overloading <^, the default pickler / !"#$%&'()*+,-./0123456789:;<=>?@AB CD- !"#$%&'()*+,-./0123456789:;<=?@ABCD`portable experimentalUwe Schmidt (uwe@fh-wedel.de)UEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~UEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~a Creates the F2 datastructure from a simplified Relax NG schema. 9Transforms each XML-element to the corresponding pattern Transforms a ref-element. G The value of the name-attribute is looked up in the environment list - to find the corresponding define-pattern. E Haskells lazy-evaluation is used to transform circular structures. !Transforms a notAllowed-element. Creates an error message. Transforms a choice-element. !Transforms a interleave-element. Transforms a group-element.  Transforms a oneOrMore-element. Transforms a list-element. *Transforms a data- or dataExcept-element. Transforms a value-element.  Transforms a attribute-element.  The first child is a F', the second (the last) one a pattern. Transforms a element-element.  The first child is a F', the second (the last) one a pattern.  Creates a F from an "anyName"-, "nsName"- or "name" -Pattern, Simple access arrows b:Returns a string representation of the pattern structure.  (see also: a)  Example:  9 Element {}foo (Choice (Choice (Value ("","token") "abc" B ("foo","www.bar.baz")]))(Data ("http://www.mysql.com","VARCHAR") K [("length","2"),("maxLength","5")])) (Element {}bar (Group (Element {}baz The function can not5 be used to display circular ref-pattern structures. 0Returns a string representation of a nameclass. 8Returns a tree representation of the pattern structure. The hard work is done by .  Example:   +---element {}bar  |  +---group  |  +---oneOrMore  | | # | +---attribute AnyName  | |  | +---text  |  +---text EThe function can be used to display circular ref-pattern structures.  Example:  <define name="baz">  <element name="baz">  ... <ref name="baz"/> ...  </element>  </define> 8Returns a tree representation of the pattern structure.  (see also: a and b) CReturns a formated string representation of the pattern structure.  (see also: a and b) CReturns a formated string representation of the pattern structure.  Example:  / Element {}foo (Choice (Choice ( Value = abc, G datatypelibrary = http://relaxng.org/ns/structure/1.0, type = token, & context (base-uri =file://test.rng, N parameter: xml = http://www.w3.org/XML/1998/namespaces, foo = www.bar.baz), EThe function can be used to display circular ref-pattern structures. cdeportable experimentalUwe Schmidt (uwe@fh-wedel.de)@@the default global state, used as initial state when running an e with Y or  e  apply an e to an empty root node with e () as initial state 7the main entry point for running a state arrow with IO  when running  runX f& an empty XML root node is applied to f.  usually f? will start with a constant arrow (ignoring the input), e.g. a ,Text.XML.HXT.Arrow.ReadDocument.readDocument arrow. for usage see examples with .Text.XML.HXT.Arrow.WriteDocument.writeDocument +if input has to be feed into the arrow use Y like in  runIOSLA f emptyX inputDoc  (read the user defined part of the state *change the user defined part of the state 'set the user defined part of the state extend user state FRun an arrow with an extended user state component, The old component N is stored together with a new one in a pair, the arrow is executed with this M extended state, and the augmented state component is removed form the state + when the arrow has finished its execution change the type of user state CThis conversion is useful, when running a state arrow with another I structure of the user state, e.g. with () when executing some IO arrows Estore a single XML tree in global state under a given attribute name Nstore a list of XML trees in global system state under a given attribute name ?remove an entry in global state, arrow input remains unchanged *read an attribute value from global state &read all attributes from global state 'read a string value from global state,  if parameter not set "" is returned #store an int value in global state $read an int value from global state  getParamInt 0 myIntAttr reset global error variable set global error variable !read current global error status >raise the global error status level to that of the input tree Eset the error message handler and the flag for collecting the errors +error message handler for output to stderr :the default error message handler: error output to stderr ,error message handler for collecting errors :error message handler for output to stderr and collecting *error message handler for ignoring errors 9if error messages are collected by the error handler for 7 processing these messages by the calling application, I this arrow reads the stored messages and clears the error message store 8filter error messages from input trees and issue errors generate a warnig message generate an error message 8generate a fatal error message, e.g. document not found ;add the error level and the module where the error occured e to the attributes of a document root node and remove the children when level is greater or equal to e.  called by e* when the system state indicates an error <check whether the error level attribute in the system state E is set to error, in this case the children of the document root are f removed and the module name where the error occured and the error level are added as attributes with e  else nothing is changed Ucheck whether tree is a document root and the status attribute has a value less than e Xset the base URI of a document, used e.g. for reading includes, e.g. external entities, # the input must be an absolute URI )read the base URI from the globale state Bchange the base URI with a possibly relative URI, can be used for G evaluating the xml:base attribute. Returns the new absolute base URI. 8 Fails, if input is not parsable with parseURIReference  see also: e, e Aset 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 get the default base URI aremember base uri, run an arrow and restore the base URI, used with external entity substitution set the global trace level read the global trace level arun an arrow with a given trace level, the old trace level is restored after the arrow execution 0apply a trace arrow and issue message to stderr !issue a string message as trace #issue the string input of an arrow Bissue the source representation of a document if trace level >= 3 =for better readability the source is formated with indentDoc @issue the tree representation of a document if trace level >= 4 trace a main computation step k issue a message when trace level >= 1, issue document source if level >= 3, issue tree when level is >= 4 trace the global state 7compute the absolut URI for a given URI and a base URI arrow variant of e , fails if e returns Nothing oarrow for expanding an input URI into an absolute URI using global base URI, fails if input is not a legal URI Yarrow for selecting the scheme (protocol) of the URI, fails if input is not a legal URI. #See Network.URI for URI components ]arrow for selecting the registered name (host) of the URI, fails if input is not a legal URI ?arrow for selecting the port number of the URI without leading ':'$, fails if input is not a legal URI >arrow for selecting the user info of the URI without trailing '@'$, fails if input is not a legal URI Tarrow for computing the path component of an URI, fails if input is not a legal URI Uarrow for computing the query component of an URI, fails if input is not a legal URI Xarrow for computing the fragment component of an URI, fails if input is not a legal URI Tarrow for computing the path component of an URI, fails if input is not a legal URI 9The arrow for stateful arrows with no user defined state #The arrow type for stateful arrows ;state datatype consists of a system state and a user state  the user state is not fixed >predefined system state data type with all components for the 3 system functions, like trace, error handling, ... OOfportable experimentalUwe Schmidt (uwe@fh-wedel.de) Read the content of a document. $This routine is usually called from 6Text.XML.HXT.Arrow.ProcessDocument.getDocumentContents. 0The input must be a root node (constructed with Z), usually without children. m The attribute list contains all input parameters, e.g. URI or source file name, encoding preferences, ... G If the source name is empty, the input is read from standard input. aThe source is transformed into an absolute URI. If the source is a relative URI, or a file name, L it is expanded into an absolut URI with respect to the current base URI. ' The default base URI is of protocol "file". and points to the current working directory. &The currently supported protocols are "http", "file", "stdin" and "string". :The latter two are internal protocols. An uri of the form "stdin:" stands for the content of  the standard input stream. "string:some text" means, that " some text" is taken as input. : This internal protocol is used for reading from normal  y values. gportable experimentalUwe Schmidt (uwe@fh-wedel.de)!substitution of general entities 4input: a complete document tree including root node hportable experimentalUwe Schmidt (uwe@fh-wedel.de)a filter for DTD processing $inclusion of external parts of DTD,  parameter entity substitution  conditional section evaluation Binput tree must represent a complete document including root node iportable experimentalUwe Schmidt (uwe@fh-wedel.de) XML parser _Input tree must be a root tree with a text tree as child containing the document to be parsed. PThe parser generates from the input string a tree of a wellformed XML document, Kprocesses the DTD (parameter substitution, conditional DTD parts, ...) and Zsubstitutes all general entity references. Next step is character reference substitution. &Last step is the document validation. 4Validation can be controlled by an extra parameter.  Example:  9 parseXmlDocument True -- parse and validate document  A parseXmlDocument False -- only parse document, don't validate IThis parser is useful for applications processing correct XML documents.  HTML parser _Input tree must be a root tree with a text tree as child containing the document to be parsed. _The parser tries to parse everything as HTML, if the HTML document is not wellformed XML or if Qerrors occur, warnings are generated. The warnings can be issued, or suppressed.  Example:  parseHtmlDocument True % : parse document and issue warnings VThis parser is useful for applications like web crawlers, where the pages may contain garbitray errors, but the application is only interested in parts of the document, e.g. the plain text. Document validation 5Input must be a complete document tree. The document +is validated with respect to the DTD spec. 0Only useful for XML documents containing a DTD. EIf the document is valid, it is transformed with respect to the DTD, Ynormalization of attribute values, adding default values, sorting attributes by name,... 6If no error was found, result is the normalized tree, 7else the error status is set in the list of attributes of the root node "/"4 and the document content is removed from the tree. Namespace propagation CInput must be a complete document tree. The namespace declarations Care evaluated and all element and attribute names are processed by >splitting the name into prefix, local part and namespace URI. @Naames are checked with respect to the XML namespace definition ;If no error was found, result is the unchanged input tree, 7else the error status is set in the list of attributes of the root node "/"4 and the document content is removed from the tree. .creates a new document root, adds all options 0 as attributes to the document root and calls f. DIf the document name is the empty string, the document will be read  from standard input. For supported protocols see f j`normalize a document for validation with Relax NG: remove all namespace declaration attributes, d remove all processing instructions and merge all sequences of text nodes into a single text node ;Validates a xml document with respect to a Relax NG schema = 1.parameter : the arrow for computing the Relax NG schema < 2.parameter : list of options for reading and validating " 3.parameter : XML document URI  arrow-input : ignored # arrow-output : list of errors or R ;Validates a xml document with respect to a Relax NG schema  1.parameter : XML document ! arrow-input : Relax NG schema # arrow-output : list of errors or R  tests whether a F contains a particular n 3tests whether a pattern matches the empty sequence Gcomputes the derivative of a pattern with respect to a XML-Child and a F Acomputes the derivative of a pattern with respect to a text node KTo compute the derivative of a pattern with respect to a list of strings, P simply compute the derivative with respect to each member of the list in turn. Fcomputes the derivative of a pattern with respect to a start tag open RTo compute the derivative of a pattern with respect to a sequence of attributes, G simply compute the derivative with respect to each attribute in turn. Gcomputes the derivative of a pattern with respect to a start tag close SComputing the derivative of a pattern with respect to a list of children involves G computing the derivative with respect to each pattern in turn, except - that whitespace requires special treatment. ?computes the derivative of a pattern with respect to a end tag Kapplies a function (first parameter) to the second part of a after pattern   k 4Return all reachable defines from the start pattern  -Returns the list of simplification errors or R  -Creates the simple form of a Relax NG schema  (see also: )     l +validate a document with a Relax NG schema / 1.parameter : the option list for validation / 2.parameter : the URI of the Relax NG Schema R arrow-input : the document to be validated, namespaces must have been processed { arrow-output : the input document, or in case of validation errors, an empty document with status information in the root 6options evaluated by validateDocumentWithRelaxSchema:   8R : check Relax NG schema restrictions when simplifying the schema (default: on)   :P : validate a Relax NG schema referenced by a externalRef-Pattern (default: on)   <P : validate a Relax NG schema referenced by a include-Pattern (default: on) Hall other options are propagated to the read functions for schema input  example: P validateDocumentWithRelaxSchema [(a_check_restrictions, "0")] "testSchema.rng"  ;validate an XML document with respect to a Relax NG schema < 1.parameter : the valid and simplified schema as XML tree - arrow-input : the document to be validated x arrow-output : the validated and unchanged document or the empty document with status information set in the root node .normalize a document for Relax NG validation,  call the j# function for doing the hard work,  and issue errors 3 1.parameter : the arrow for computing the schema - arrow-input : the document to be validated  arrow-output : nothing Document validation <Validates a xml document with respect to a Relax NG schema. First, the schema is validated with respect to the Relax NG Spezification. If no error is found, the xml document is validated with respect to the schema. F 1.parameter : list of options; namespace progagation is always done  2.parameter : XML document % 3.parameter : Relax NG schema file available options:  o m : do not check Relax NG schema restrictions (includes do-not-validate-externalRef, do-not-validate-include)   9I : do not validate a Relax NG schema referenced by a externalRef-Pattern   :L : validate a Relax NG schema referenced by a externalRef-Pattern (default)   ;E : do not validate a Relax NG schema referenced by a include-Pattern   <H : validate a Relax NG schema referenced by a include-Pattern (default)   =6 : output Pattern transformations in case of an error   >C : stop Relax NG simplification after the first error has occurred  all ,Text.XML.HXT.Arrow.ReadDocument.readDocument options  example: K validate [(a_do_not_check_restrictions, "1")] "test.xml" "testSchema.rng" Relax NG schema validation HValidates a Relax NG schema with respect to the Relax NG Spezification. 5 1.parameter : list of available options (see also: l) % 2.parameter : Relax NG schema file Document validation GValidates a xml document with respect to a Relax NG schema. Similar to lm, but the Relax NG Specification is not created. Can be used, to check a list of documents more efficiently. 5 1.parameter : list of available options (see also: l)  2.parameter : XML document % 3.parameter : Relax NG schema file 7 arrow-input : Relax NG Specification in simple form  example: . Text.XML.HXT.RelaxNG.Schema.relaxSchemaArrow  >>> 4 ( validateWithSpezification [] "foo.xml" "foo.rng"  &&& 4 validateWithSpezification [] "bar.xml" "bar.rng"  ) Relax NG schema validation see l and l 5 1.parameter : list of available options (see also: l) ( 2.parameter : Relax NG schema file 7 arrow-input : Relax NG Specification in simple form Document validation NValidates a xml document with respect to a Relax NG schema, but the schema is notb validated with respect to a specification first. Should be used only for valid Relax NG schemes. 5 1.parameter : list of available options (see also: l)  2.parameter : XML document % 3.parameter : Relax NG schema file        mportable experimentalUwe Schmidt (uwe@fh-wedel.de)the main document input filter Athis filter can be configured by an option list, a value of type  Attributes available options:  1: use HTML parser, else use XML parser (default)  A : validate document againsd DTD (default), else skip validation   7H : validate document with Relax NG, the options value is the schema URI d this implies using XML parser, no validation against DTD, and canonicalisation  > : check namespaces, else skip namespace processing (default)  ? : canonicalize document (default), else skip canonicalization  M : preserve comments during canonicalization, else remove comments (default)  W : remove all whitespace, used for document indentation, else skip this step (default)  J : indent document by inserting whitespace, else skip this step (default)  Q : issue warnings, when parsing HTML (default), else ignore HTML parser warnings  X : issue all error messages on stderr (default), or ignore all error messages (default)   : trace level: values: 0 - 4  . : proxy for http access, e.g. www-cache:3128  M : for http access via external programm curl, default is native HTTP access  * : more options for external program curl   : default document encoding ( 2,  !,  0,  ", ... ,  /, ...) yAll attributes not evaluated by readDocument are stored in the created document root node for easy access of the various options in e.g. the input/output modules ?If the document name is the empty string or an uri of the form "stdin:",, the document is read from standard input.  examples:   readDocument [ ] "test.xml" reads and validates a document "test.xml"@, no namespace propagation, only canonicalization is performed  " readDocument [ (a_validate, "0") ( , (a_encoding, isoLatin1)  ] "test.xml" reads document "test.xml"& without validation, default encoding  !.  $ readDocument [ (a_parse_html, "1") ( , (a_encoding, isoLatin1)  ] "" hreads a HTML document from standard input, no validation is done when parsing HTML, default encoding is  !  ( readDocument [ (a_parse_html, "1") 5 , (a_proxy, "www-cache:3128") ( , (a_curl, "1") ( , (a_issue_warnings, "0") * ] "http://www.haskell.org/" treads Haskell homepage with HTML parser ignoring any warnings, with http access via external program curl and proxy " www-cache" at port 3128  + readDocument [ (a_validate, "1") + , (a_check_namespace, "1") + , (a_remove_whitespace, "1") + , (a_trace, "2") & ] "http://www.w3c.org/" yread w3c home page (xhtml), validate and check namespaces, remove whitespace between tags, trace activities with level 2 "for minimal complete examples see .Text.XML.HXT.Arrow.WriteDocument.writeDocument and e4, the main starting point for running an XML arrow. the arrow version of m$, the arrow input is the source URI :read a document that is stored in a normal Haskell String Fthe same function as readDocument, but the parameter forms the input.  All options available for m are applicable for readString. VDefault encoding: No encoding is done, the String argument is taken as Unicode string the arrow version of m$, the arrow input is the source URI Vparse a string as HTML content, substitute all HTML entity refs and canonicalize tree 2 (substitute char refs, ...). Errors are ignored. A simpler version of m but with less functionality.  Does not run in the IO monad _parse a string as XML content, substitute all predefined XML entity refs and canonicalize tree  (substitute char refs, ...) n0 The core-functions library @Returns the table of keys, needed by xslt, from the environment 4Returns the table of variables from the environment RReturns the conversion function for the XPath results: string, boolean and number ! A nodeset can not be converted. 6Filter for ordering a list of Nodes in document order >Filter for ordering a list of Nodes in reverse document order :Filter for removing identical fragment trees in a nodeset PCheck whether a node is not a part of a node list. Needed to implement matching & testing in xslt. @Calculates the position of a node in a tree (in document order)  Evaluates a function. b Calculation of the function value is done by looking up the function name in the function table, @ check the number of arguments and calculate the funtion, if no ' argument evaluation returns an error. ! returns : the function value as !C !Converts a list of different !C types in a list of one !C type. , 1.parameter fct : the conversion function anumber last(): returns a number equal to the context size from the expression evaluation context inumber position(): returns a number equal to the context position from the expression evaluation context Mnumber count(node-set): returns the number of nodes in the argument node-set :node-set id(object): selects elements by their unique ID Dreturns all IDs from the variable environment as a list of strings. , the IDs are stored in the variable: idAttr string local-name(node-set?): t returns the local part of the expanded-name of the node in the argument node-set that is first in document order. i If the argument node-set is empty or the first node has no expanded-name, an empty string is returned. ` If the argument is omitted, it defaults to a node-set with the context node as its only member !string namespace-uri(node-set?): v returns the namespace URI of the expanded-name of the node in the argument node-set that is first in document order. s If the argument node-set is empty, the first node has no expanded-name, or the namespace URI of the expanded-name  is null, an empty string is returned. If the argument is omitted, it defaults to a node-set with the context node as its only member string name(node-set?): j returns a string containing a QName representing the expanded-name of the node in the argument node-set m that is first in document order. If the argument node-set is empty or the first node has no expanded-name, ~ an empty string is returned. If the argument it omitted, it defaults to a node-set with the context node as its only member.  Tim Walkenhorst: some helper functions "$Returns the string-value of a node, 0 the value of a namespace node is not supported #7string string(object?): converts an object to a string Sstring concat(string, string, string*): returns the concatenation of its arguments &boolean starts-with(string, string): 3 returns true if the first argument string starts > with the second argument string, and otherwise returns false "boolean contains(string, string): l returns true if the first argument string contains the second argument string, and otherwise returns false )string substring-before(string, string): v returns the substring of the first argument string that precedes the first occurrence of the second argument string | in the first argument string, or the empty string if the first argument string does not contain the second argument string (string substring-after(string, string): u returns the substring of the first argument string that follows the first occurrence of the second argument string | in the first argument string, or the empty string if the first argument string does not contain the second argument string +string substring(string, number, number?): h returns the substring of the first argument starting at the position specified in the second argument p with length specified in the third argument. If the third argument is not specified, it returns the substring d starting at the position specified in the second argument and continuing to the end of the string. number string-length(string?): n returns the number of characters in the string. If the argument is omitted, it defaults to the context node M converted to a string, in other words the string-value of the context node. !string normalize-space(string?): ~ returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences  of whitespace characters by a single space. If the argument is omitted, it defaults to the context node converted to a string, 6 in other words the string-value of the context node. F The string is parsed by a function parseStr from XPathParser module. <-- No longer! Tim Walkenhorst *string translate(string, string, string): ~ returns the first argument string with occurrences of characters in the second argument string replaced by the character at 9 the corresponding position in the third argument string $Bboolean boolean(object): converts its argument to a boolean value Qboolean not(boolean): returns true if its argument is false, and false otherwise boolean true(): returns true boolean false(): returns false boolean lang(string): r returns true or false depending on whether the language of the context node as specified by xml:lang attributes U is the same as or is a sublanguage of the language specified by the argument string %:number number(object?): converts its argument to a number number sum(node-set): L returns the sum, for each node in the argument node-set, of the result of 6 converting the string-values of the node to a number enumber floor(number): returns the largest (closest to positive infinity) number that is not greater * than the argument and that is an integer enumber ceiling(number): returns the smallest (closest to negative infinity) number that is not less * than the argument and that is an integer number round(number): M returns the number that is closest to the argument and that is an integer. _ If there are two such numbers, then the one that is closest to positive infinity is returned. node-set key(string, object): 1 does for keys what the id function does for IDs 3 The first argument specifies the name of the key. F When the second argument is of type node-set, then the result is the F union of the result of applying the key function to the string value 0 of each of the nodes in the argument node-set. @ When the second argument is of any other type, the argument is  converted to a string /string format-number(number, string, string?): I converts its first argument to a string using the format pattern string F specified by the second argument and the decimal-format named by the N third argument, or the default decimal-format, if there is no third argument calculate an ID for a NODE D returns : a list of numbers, one number for each level of the tree BTests whether the number of current function arguments is correct OEach table entry consists of the function and the expected function arguments. .All functions are stored in a function table. &HType signature for all functions which can be used in the XPath module.  !"#$%&& !%$#"oportable experimentalUwe Schmidt (uwe@fh-wedel.de)'3Select parts of a document by an XPath expression. =The main filter for selecting parts of a document via XPath. P The string argument must be a XPath expression with an absolute location path, 5 the argument tree must be a complete document tree. W Result is a possibly empty list of XmlTrees forming the set of selected XPath values. G XPath values other than XmlTrees (numbers, attributes, tagnames, ...)  are convertet to text nodes. (BSelect parts of a document by a namespace aware XPath expression.  Works like 'o8 but the prefix:localpart names in the XPath expression A are interpreted with respect to the given namespace environment )3Select parts of an XML tree by a XPath expression. HThe main filter for selecting parts of an arbitrary XML tree via XPath. P The string argument must be a XPath expression with an absolute location path, 0 There are no restrictions on the arument tree. =No canonicalization is performed before evaluating the query VResult is a possibly empty list of XmlTrees forming the set of selected XPath values. G XPath values other than XmlTrees (numbers, attributes, tagnames, ...)  are convertet to text nodes. *Same as )o+ but with namespace aware XPath expression +'compute the node set of an XPath query ,6compute the node set of a namespace aware XPath query 5parse xpath, evaluate xpath expr and prepare results -"The main evaluation entry point.  Each XPath-gC* is mapped to an evaluation function. The C0-parameter contains the set of global variables  for the evaluator, the *CF-parameter the root of the tree in which the expression is evaluated. *filter for evaluating a filter-expression !Hreturns the union of its arguments, the arguments have to be node-sets. "OEquality or relational test for node-sets, numbers, boolean values or strings, 4 each computation of two operands is done by relEqEv' #/Equality or relational test for two node-sets. R The comparison will be true if and only if there is a node in the first node-set J and a node in the second node-set such that the result of performing the : comparison on the string-values of the two nodes is true $2Comparison between a node-set and different type. Y The node-set is converted in a boolean value if the second argument is of type boolean. e If the argument is of type number, the node-set is converted in a number, otherwise it is converted  in a string value. %FNo node-set is involved and the operator is equality or not-equality. R The arguments are converted in a common type. If one argument is a boolean value c then it is the boolean type. If a number is involved, the arguments have to converted in numbers, * else the string type is the common type. &9Filter for accessing the root element of a document tree '/Filter for accessing all nodes of a XPath-axis " 1.parameter as : axis specifier (Axis-Function-Table. H Each XPath axis-specifier is mapped to the corresponding axis-function )evaluates a location path, > evaluation of an absolute path starts at the document root, ' the relative path at the context node *evaluate a single XPath step ! namespace-axis is not supported +Lfilter for selecting a special type of nodes from the current fragment tree Bthe filter works with namespace activated and without namespaces. E If namespaces occur in XPath names, the uris are used for matching,  else the name prefix  Bugfix : *7 (or any other name-test) must not match the root node ,*tests whether a node is of a special type -:the filter selects the NTree part of a navigable tree and 1 tests whether the node is of the necessary type a 1.parameter fct : filter function from the XmlTreeFilter module which tests the type of a node .=evaluates a boolean expression, the evaluation is non-strict / returns the value of a variable 0evaluates a function,  computation is done by XPathFct.evalFct which is defined in XPathFct. 1#evaluates an arithmetic operation. *1.parameter f : arithmetic function from XPathArithmetic 2>Convert list of ID attributes from DTD into a space separated #C 3DExtracts all ID-attributes from the document type definition (DTD). '()*+,-'()*+,-kl'()*+,-pportable experimentalUwe Schmidt (uwe@fh-wedel.de) .KSelect parts of a whole XML document with root node by a XPath expression. =The main filter for selecting parts of a document via XPath. OThe string argument must be a XPath expression with an absolute location path, 5 the argument tree must be a complete document tree. ABefore evaluating the xpath query, the document is canonicalized  with ,Text.XML.HXT.Arrow.Edit.canonicalizeForXPath VResult is a possibly empty list of XmlTrees forming the set of selected XPath values. G XPath values other than XmlTrees (numbers, attributes, tagnames, ...)  are convertet to text nodes. /Same as .p4 but with namespace environment for the XPath names 0=Select parts of an arbitrary XML tree by a XPath expression. HThe main filter for selecting parts of an arbitrary XML tree via XPath. P The string argument must be a XPath expression with an absolute location path, 1 There are no restrictions on the argument tree. =No canonicalization is performed before evaluating the query VResult is a possibly empty list of XmlTrees forming the set of selected XPath values. G XPath values other than XmlTrees (numbers, attributes, tagnames, ...)  are convertet to text nodes. 1Same as 0p4 but with namespace environment for the XPath names 2HSelect a set of nodes via an XPath expression from an arbitray XML tree The result is a set of "pointers"# to nodes. This set can be used to D access or modify the values of the subnodes in subsequent calls to 5p or 8p. gThis function enables for parsing an XPath expressions and traversing the tree for node selection once \ and reuse this result possibly many times for later selection and modification operations. 4Same as 2p4 but with namespace environment for the XPath names 3Ucompute a node set from a tree, containing all nodes selected by the predicate arrow 2computation of the set of element nodes with name "a" is done with  getElemNodeSet (hasName "a") 4Ocompute a node set from a tree, containing all nodes including attribute nodes  elected by the predicate arrow 5@select all subtrees specified by a previously computed node set the following law holds: / getFromNodeSet $< getElemNodeSet f == multi f 65process all subtrees selected by an XPath expression the following law holds: T processXPathTrees p xpathExpr == processFromNodeSet p $< getXPathNodeSet xpathExpr 7Same as 6p4 but with namespace environment for the XPath names 8Uprocess all subtrees specified by a previously computed node set in bottom up manner the follwoing law holds:  J processFromNodeSet g $< getElemNodeSet f == processBottomUp (g `when` f) 3when attributes are contained in the node set (see 4p), these are processed / after the children and before the node itself wthe advantage of processFromNodeSet is the separation of the selection of set of nodes to be processed (e.g. modified) j from the real proccessing. The selection sometimes can be done once, the processing possibly many times. ./012345678 ./013425678qportable experimentalUwe Schmidt (uwe\@fh-wedel.de)T def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >BCEFGHKOY_nopqr      !"#%&789:IJKMNOWXghjmnl-9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc+:9;<=>?ABH@CDEFGIbcJKLMaNOPRQSTUVWXYZ[\]^_`rportable experimentalUwe Schmidt (uwe@fh-wedel.de)9defg 5h 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q Ri S T U V W X Y Z [ \ ] ^ _ ` a b cj d ekdefghijksportable experimentalUwe Schmidt (uwe\@fh-wedel.de)Glmnopqrstuvwxyz{ f|}~ g h i j k l m n o p q r s t u v w x y z { | } ~      (lmnopqrstuvwxyz{|}~tportable experimentalUwe Schmidt (uwe\@fh-wedel.de)uportable experimentalUwe Schmidt (uwe\@fh-wedel.de)vportable experimentalUwe Schmidt (uwe@fh-wedel.de) Uarrow for applying a pure partial function, catch the error case and issue the error lift prepareXSLTDocument read an XSLT stylesheet MNormalize stylesheet, expand includes, select imports and assemble the rules 1read an include and check for recursive includes SCompile a document representing an XSLT stylesheet into an internal representation KThe internal representation is an abstract syntax tree for the XSLT rules. S XSLT imports and includes are evaluated and the rules are normalized and prepared  for easy application. JA convinient function for combining reading a stylesheet and compilation. FReading an XSLT stylesheet is always done without validation but with B namespace propagation. Comments are removed from the stylesheet. :apply a compiled XSLT stylesheet to a whole document tree 4The compiled stylesheet must have been created with v  or v Bapply an XSLT stylesheet given by an URI to a whole document tree 8The string parameter is the URI of the XSLT stylesheet. M In case of an error during stylesheet compilation or stylesheet application / all children of the root node are removed and W the error status is set in the attribute list of the root node of the input document. t ~           w6write the tree representation of a document to a file 1write a document with indentaion and line numers xportable experimentalUwe Schmidt (uwe@fh-wedel.de)&the main filter for writing documents 5this filter can be configured by an option list like ,Text.XML.HXT.Arrow.ReadDocument.readDocument usage: & writeDocument optionList destination  if  destination  is the empty string or "-"", stdout is used as output device available options are  > : indent document for readability, (default: no indentation)  J : remove all redundant whitespace for shorten text (default: no removal)  $ : encoding of document, default is  or  2  0 : (default) issue XML: quote special XML chars >,<,",',& where neccessary 2 add XML processing instruction 7 and encode document with respect to , W if explicitly switched of, the plain text is issued, this is useful U for non XML output, e.g. generated Haskell code, LaTex, Java, ...  ] : issue XHTML: quote alle XML chars, use HTML entity refs or char refs for none ASCII chars   : suppress generation of < ?xml ... ?> processing instruction  8 : show tree representation of document (for debugging)  : : show Haskell representaion of document (for debugging) .a minimal main program for copying a document  has the following structure:   module Main  where   import Text.XML.HXT.Arrow   main :: IO ()  main  = do + runX ( readDocument [] "hello.xml"  >>> ) writeDocument [] "bye.xml"  )  return () Tan example for copying a document to standard output with tracing and evaluation of error code is:  module Main  where   import Text.XML.HXT.Arrow  import System.Exit   main :: IO ()  main  = do 5 [rc] <- runX ( readDocument [ (a_trace, "1") 2 ] "hello.xml"  >>> E writeDocument [ (a_output_encoding, isoLatin1) E ] "-" -- output to stdout  >>> # getErrStatus  ) ! exitWith ( if rc >= c_err % then ExitFailure 1 # else ExitSuccess  ) AConvert a document into a string. Formating is done the same way ! and with the same options as in x. _portable experimentalUwe Schmidt (uwe@fh-wedel.de) 5store an arbitray value in a persistent XML document HThe pickler converts a value into an XML tree, this is written out with   Text.XML.HXT.Arrow.writeDocument. The option list is passed to  Text.XML.HXT.Arrow.writeDocument &An options evaluated by this arrow is _.  If _ is set (f @), the pickler DTD is added as an inline DTD into the document. >Option for generating and adding DTD when document is pickled ,read an arbitray value from an XML document The document is read with Text.XML.HXT.Arrow.readDocument. Options are passed  to Text.XML.HXT.Arrow.readDocument/. The conversion from XmlTree is done with the  pickler. 7 xpickleDocument xp al dest >>> xunpickleDocument xp al' dest  is the identity arrow ] when applied with the appropriate options. When during pickling indentation is switched on, 3 the whitespace must be removed during unpickling. 4Write out the DTD generated out of a pickler. Calls  xpicklerDTD 2The arrow for generating the DTD out of a pickler =A DTD is generated from a pickler and check for consistency. ' Errors concerning the DTD are issued. An arrow for checking picklers @A value is transformed into an XML document by a given pickler, ? the associated DTD is extracted from the pickler and checked, < the document including the DTD is tranlated into a string, = this string is read and validated against the included DTD,  and unpickled. / The last step is the equality with the input. AIf the check succeeds, the arrow works like this, else it fails. *The arrow version of the pickler function ,The arrow version of the unpickler function (Compute the associated DTD of a pickler 1DHJ !"#$%&'()*+,-./0123456789:;<=>?@A1=>?@A;*+:5798%#6<!"342(0$,.-/1) &'JHDportable experimentalUwe Schmidt (uwe@fh-wedel.de) def   g                 h       ij !k " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6lmn 7o 8 9 : ; < = >qrstuvwxyz{|}~UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~DHJopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW !"#$%&'()*+,-./0123456789:;<=>?@A./012345678                 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\Z]^_`abcdefghijklmnonpqrstuvwxyz{{{]|}~]|}]|} ~     !"#$%&'()*+,-./0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s r ] | t u v w x y z { | } ~    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"B""""""""""@""""""""""""D"""";""""""""""""""""""" " " " " """"""E"""""""""""""" "!"["U"""#"$"%"&"'"(")"*"+","-"."/"8"0"1"2"3"4"5"6"7"8"9":";"<"=">"?"@"A"B"C"D"E"F"G"H"I#J#K$U$V$W$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$X$\$]$^$_$S$`$a$b$c$d$e$f$g$h$i$j$k$Z$l$m$n$o$p$q$r$s$t$u$v$w$x$x$y$z${$|$|$}$~$$x$$|%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&'''''''''''()*****************************************************+,-./00000000111111111111111111111111111 1 1 1 1 1112222222334444444 4!4"4#4$5%5&5'6(6)6*6+6,6-6.6/606162636475767778797:7;8<8=8>8?9@9A:B:C;D<=E>F?G?B?E?D?C?H@IAJAKALAMBNBOBPBQBRBSBTBUBVBWBXBYCZC[C\C]C^C_C`CaCbCcCdCeCfCgChCiCjCkClCmCnCoCpCqCrCsCtCuCvCwCxCyCzC{C|C}C~CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCgCfCeCdCcCwCvCuCtC{CzCyCCCCCCCCCCCC~C}CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC]C|C}CCCCC~C C CC C CCCCCCCC CDDDDDDEEEEEFFFFFFFFFFFFFFFFFFFFFFFkFFFpFFFFFFFFFFFFFFFFFF[GGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHII I I I I IIIIIJJJJJJJJJJJJJJ J!J"J#J$J%J&J'J(J)J*J+J,J-J.J/J0J1J2J3J4J5J6J7JrJ8J9J:J;J<J=J>K?K@KAKBKCKDKEKFKGKHKIKJKKKLKMKNKOKPKQKRKSLTLUMVMWMXNYNZO[O\P]Q^QUQ_QWQVQ`RaRbRcRdReRfRgRhRiRjRkRlRmRRRnRoRpRqRrRsRtRuRvRwRxSSSySzS{SSS|SS}SS~SSSSSSSSSSSSSSSSSSSSSSSSSSTTdTcThTgTfTeTTTTTTTTTTTTTTUUUUVVVVWWWWWWWWXXXYYYYYZZZZZZZZZZZZZZZ7ZZZZZZ;Z<Z=Z>Z?Z@ZZAZCZDZEZBZZZZZZZZZZZZZFZGZHZIZJZLZ4Z6ZKZZZZZZZ?Z>ZAZZZBZFZGZHZCZZ@ZMZNZOZPZQZRZSZTZUZVZWZXZYZZZZ[Z]Z^Z_Z`ZaZZZZZbZcZZeZgZhZZfZZmZoZpZZ/Z8ZZZ*ZZ3ZZZZZZZZZZZZ]Z|Z}ZZZZZ~ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ Z Z Z Z ZZZZZZZZZZZZZZZZZZZ Z!Z"Z#Z$Z%Z&Z'Z(Z)Z*Z+Z,Z-Z.Z/Z0Z1Z2Z3Z4ZtZvZwZxZyZzZ5Z6Z7Z8Z9Z:Z;Z<Z=Z>Z?Z@ZAZ~ZZZBZCZDZEZFZGZHZIZJ[[[K[[[[L[[[[[[[[[[[[[[[M[N[O[P[Q[R[S\T\U\V\W\X\Y\Z\[\\\]\\]] ]]]]]:];]9] ] ]&]]E]^]_]`]a^b^c^d^e^f^^g^h^i^j^k^l^m^n^o^p^q^r^s^t^u^v^w^x^y^z^{^|^}^~^^^^^^^^^^^^^^^^`````````````````````````````````````````````````````````````````````````````````````aaaabbbbbbccddeeOeeeeeeeXeeeeeeeeeeeeeeeeeeee e emeneoe e e ee eeeee`eaeeceeeeeedeeeeeeeeeeeee e e!e"e#e$e%e&e'e(e)e*e+e,e-f.fff/f0g?h>iii1ii2j3j4j5j6j7j8j9k:k;l<l=lGl>l?l@lAmBmCmDmEmFmnGnHnInJnKnLnMnNnOnPnQnRnSnToUoVoWoXoYoZo[p\p]p^p_pYp`papbpcpdpeqfqgqhqiqjqkqlqmqnqoqpqqqrqsqtquqvqwqxqyqzq{q|q}q~qqqqqqqqqqqqqqqqqqrrrrrrrrsssssssssssssssssssssssssssssssssssssssstttuuvvvvwKwwwwxMx_________                                                              ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c defgyhijk%l7m8n8o8p9q9r9s9t9u9v9w9x9y9z9T9X9{9|9}:~::::;;;;;;;;<=============>>>>>>>AEFFFFFFFFFFFFFFFFFFFFFFFFFFrFFFHHHHHIIIIJJJJJJJJJKSLLLLLLLMMMyyyy[[\\\yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy^aaaaaaaaaaa a a e e e y jj j j j j j j j j k n n n n n n n n n n n n n n n n n !n "n #n $n %n &n 'n (n )n *n +n ,n -n .n /n 0n 1n 2o 3o 4o 5o 6o 7o 8o 9o :o ;o <o =o >o ?o @o Ao Bo Co Do Eo Fo GpZr Hr Ir Jr Kr Lr Mr Nr Or Pr Qr Rr Sr Tr Ur Vr Wr Xr Yr Zr [r \r ]r ^r _r `r ar br cr dr er fr gr hr ir jr kr lr mr nr or pr qr rr sr tr ur vr wr xs ysssss zs {s |s }s ~s s s s s s s s s s s s s s s s ss s s s v v v v v hxt-7.4 Text.XML.HXT.XPath.XPathKeywordsText.XML.HXT.Validator.RE$Text.XML.HXT.RelaxNG.XmlSchema.Regex&Text.XML.HXT.RelaxNG.Unicode.CharProps#Text.XML.HXT.RelaxNG.Unicode.BlocksText.XML.HXT.DOM.IsoLatinTablesText.XML.HXT.Parser.XmlEntities!Text.XML.HXT.Parser.XhtmlEntitiesText.XML.HXT.IO.GetFILEText.XML.HXT.DOM.XmlKeywordsSystem.PipeOpenText.XML.HXT.DOM.Util'Text.XML.HXT.Parser.ProtocolHandlerUtilText.XML.HXT.IO.GetHTTPNativeText.XML.HXT.IO.GetHTTPCurlData.Char.UTF8Text.XML.HXT.DOM.UTF8DecodingText.XML.HXT.DOM.Unicode!Text.XML.HXT.Parser.XmlCharParser*Text.XML.HXT.RelaxNG.XmlSchema.RegexParserData.AssocListControl.Monad.MonadStateIOData.Tree.ClassControl.Strategies.DeepSeqData.Tree.NTree.TypeDefsData.Tree.NTree.Filter Data.NavTreeText.XML.HXT.DOM.TypeDefsText.XML.HXT.DOM.XmlOptionsText.XML.HXT.DOM.XmlTreeTypes$Text.XML.HXT.DOM.NamespacePredicatesText.XML.HXT.Arrow.XmlNode!Text.XML.HXT.DOM.XmlTreeFunctionsText.XML.HXT.DOM.XmlTreeFilterText.XML.HXT.DOM.FormatXmlTreeText.XML.HXT.DOM.XmlStateText.XML.HXT.DOM.EditFilters Text.XML.HXT.DOM.NamespaceFilterText.XML.HXT.Parser.XmlOutputText.XML.HXT.DOM.NamespaceText.XML.HXT.Parser.DefaultURI"Text.XML.HXT.Parser.XmlTokenParser'Text.XML.HXT.Parser.ProtocolHandlerFile+Text.XML.HXT.Parser.ProtocolHandlerHttpCurl-Text.XML.HXT.Parser.ProtocolHandlerHttpNative3Text.XML.HXT.Parser.ProtocolHandlerHttpNativeOrCurl#Text.XML.HXT.Parser.ProtocolHandler%Text.XML.HXT.Parser.XmlDTDTokenParserText.XML.HXT.Parser.XmlParsecText.XML.HXT.Parser.HtmlParsecText.XML.HXT.Parser.XmlParserText.XML.HXT.Parser.XmlInputText.XML.HXT.Parser.HtmlParserText.XML.HXT.RelaxNG.Utils Text.XML.HXT.Parser.XmlDTDParser!Text.XML.HXT.Parser.DTDProcessing/Text.XML.HXT.Validator.AttributeValueValidation$Text.XML.HXT.Validator.DTDValidation(Text.XML.HXT.Validator.DocTransformationText.XML.HXT.Validator.XmlRE$Text.XML.HXT.Validator.DocValidation#Text.XML.HXT.Validator.IdValidation'Text.XML.HXT.Validator.ValidationFilter!Text.XML.HXT.Validator.Validation!Text.XML.HXT.Parser.MainFunctionsText.XML.HXT.XPath.NavTree!Text.XML.HXT.XPath.XPathDataTypes Text.XML.HXT.XPath.XPathToString"Text.XML.HXT.XPath.XPathArithmeticText.XML.HXT.RelaxNG.DataTypes%Text.XML.HXT.RelaxNG.PatternFunctions%Text.XML.HXT.RelaxNG.DataTypeLibUtils-Text.XML.HXT.RelaxNG.XmlSchema.DataTypeLibW3C Text.XML.HXT.Arrow.Pickle.SchemaText.XML.HXT.Arrow.Pickle.DTD%Text.XML.HXT.RelaxNG.DataTypeLibMysql&Text.XML.HXT.RelaxNG.DataTypeLibrariesText.XML.HXT.XPath.XPathParser!Text.XML.HXT.XPath.XPathToNodeSetControl.Arrow.ArrowStrictControl.Arrow.ArrowStateControl.Arrow.ArrowListControl.Arrow.ArrowIfControl.Arrow.ArrowTreeControl.Arrow.ListArrowControl.Arrow.StateListArrowControl.Arrow.ArrowIOControl.Arrow.IOListArrowControl.Arrow.IOStateListArrowText.XML.HXT.Arrow.XmlArrowText.XML.HXT.Arrow.EditText.XML.HXT.Arrow.Namespace"Text.XML.HXT.Arrow.ParserInterfaceText.XML.HXT.Arrow.Pickle.XmlText.XML.HXT.Arrow.Pickle Text.XML.HXT.RelaxNG.BasicArrows"Text.XML.HXT.RelaxNG.CreatePattern$Text.XML.HXT.RelaxNG.PatternToStringText.XML.HXT.RelaxNG.Schema"Text.XML.HXT.RelaxNG.SchemaGrammar"Text.XML.HXT.Arrow.XmlIOStateArrow Text.XML.HXT.Arrow.DocumentInput,Text.XML.HXT.Arrow.GeneralEntitySubstitution Text.XML.HXT.Arrow.DTDProcessing"Text.XML.HXT.Arrow.ProcessDocumentText.XML.HXT.RelaxNG.Validation#Text.XML.HXT.RelaxNG.SimplificationText.XML.HXT.RelaxNG.ValidatorText.XML.HXT.Arrow.ReadDocumentText.XML.HXT.XPath.XPathFctText.XML.HXT.XPath.XPathEvalText.XML.HXT.Arrow.XmlNodeSetText.XML.HXT.XSLT.CommonText.XML.HXT.XSLT.Names$Text.XML.HXT.XSLT.CompiledStylesheetText.XML.HXT.XSLT.ApplicationText.XML.HXT.XSLT.CompilationText.XML.HXT.XSLT.XsltArrows!Text.XML.HXT.Arrow.DocumentOutput Text.XML.HXT.Arrow.WriteDocumentbase Data.BoolText.XML.HXT.Arrow.DOMInterfaceText.XML.HXT.DOM.XmlTreeText.XML.HXT.DOMText.XML.HXT.Parser Control.ArrowGHC.List Data.ListControl.Arrow.ListArrowsGHC.BaseText.XML.HXT.XPathText.XML.HXT.RelaxNGText.XML.HXT.Arrowa_ancestor_or_selfn_textre_zerore_unitre_symre_dotre_repre_plusre_optre_seqre_altnullablematchescheckREprintRERERE_ALTRE_SEQRE_OPTRE_PLUSRE_REPRE_DOTRE_SYMRE_UNITRE_ZEROcharscharRngsmkZeromkUnitmkSymmkSym1mkSymRngmkDotmkStarmkAltmkSeqmkRepmkRngmkOptmkDifmkCompldeltamatchRegex isUnicodeC isUnicodeCc isUnicodeCf isUnicodeCo isUnicodeCs isUnicodeL isUnicodeLl isUnicodeLm isUnicodeLo isUnicodeLt isUnicodeLu isUnicodeM isUnicodeMc isUnicodeMe isUnicodeMn isUnicodeN isUnicodeNd isUnicodeNl isUnicodeNo isUnicodeP isUnicodePc isUnicodePd isUnicodePe isUnicodePf isUnicodePi isUnicodePo isUnicodePs isUnicodeS isUnicodeSc isUnicodeSk isUnicodeSm isUnicodeSo isUnicodeZ isUnicodeZl isUnicodeZp isUnicodeZs codeBlocks iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5 iso_8859_6 iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11 iso_8859_13 iso_8859_14 iso_8859_15 iso_8859_16 xmlEntities xhtmlEntities getStdinContgetContt_root a_defaultv_1k_cdatatransferProtocol httpPrefixstringProtocol iso8859_1 xmlNamespacexmlnsNamespacerelaxNamespacea_do_not_check_restrictionspopen stringTrim stringToUppernormalizeNumbernormalizeWhitespacenormalizeBlanks escapeURIstringEscapeXml textEscapeXml attrEscapeXml stringToInthexStringToIntdecimalStringToIntstringToHexStringcharToHexStringintToHexStringdoublessingles noDoublesswappartitionEithertoMaybeuncurry3uncurry4parseContentType encodeOneencode decodeOnedecodedecodeEmbedErrorsError decodeUtf8decodeUtf8EmbedErrorsisXmlLatin1Char unicodeToUtf8unicodeCharToUtf8 isXmlCharisXmlSpaceCharisXml11SpaceChar isXmlNameCharisXmlNameStartCharisXmlNCNameCharisXmlNCNameStartCharisXmlPubidChar isXmlLetter isXmlBaseCharisXmlIdeographicCharisXmlCombiningChar isXmlDigit isXmlExtender"isXmlControlOrPermanentlyUndefinedlatin1ToUnicodeucs2BigEndianToUnicodeucs2LittleEndianToUnicode ucs2ToUnicode utf8ToUnicodeutf8ToUnicodeEmbedErrorsutf16beToUnicodeutf16leToUnicodeunicodeToXmlEntityunicodeToLatin1unicodeRemoveNoneAsciiunicodeRemoveNoneLatin1 intToCharRefintToCharRefHex normalizeNLgetDecodingFctgetDecodingFctEmbedErrorsgetOutputEncodingFct guessEncodingDecodingFctEmbedErrorsUStringWithErrors DecodingFct UTF8StringUTF8CharUStringUnicodexmlChar xmlNameCharxmlNameStartChar xmlNCNameCharxmlNCNameStartChar xmlLetter xmlSpaceChar parseRegex lookupDeflookup1hasEntryaddEntry addEntriesdelEntry delEntries AssocListiotrcState changeStatesetStategetStaterunStateIOSTIOtrans :CoStateIO$f1TreemkTreemkLeafisLeafisInnergetNode getChildren changeNodechangeChildrensetNode setChildrenfoldTree nodesTree depthTreecardTree formatTree:DTree:TTree $dmmkLeaf $dmisLeaf $dmisInner $dmsetNode$dmsetChildren$!!strictDeepSeqdeepSeq formatNTreeFNTreesNTree$f2$f3$f8$f4$f5$f6$f7 satisfiesnonethisisOfisOfNodemkNTree replaceNodereplaceChildren modifyNode modifyNode0modifyChildren substChildreno.>seqF+++..>catprocessChildren$$orElseiffwhenwhenNotguardsnegchoice containing notContaining containingM/>>seqM+++>>catMifMchoiceMwhenMwhenNotMguardsMprocessChildrenMprocessTopDownMprocessBottomUpM$$<liftMf performActionIfThen:->TSFilterTFilterntree subtreeNTdataNTupNTdownNTleftNTrightNT preorderNT revPreorderNT getChildrenNTo' maybeStar maybePlusNavTreeNT qualifiedName universalName universalUribuildUniversalNamemkNamemkPrefixLocalPartmkNsName mkSNsName nullQName equalQName equivQNameequivUri equalQNameBynormalizeNsUric_okc_warnc_errc_fatal ChildNodes XmlNodeSetXNSthisNode attrNodes childNodesNsEnvQNameQN namePrefix localPart namespaceUri AttributesDTDElemPEREFNAMECONDSECTNOTATIONPENTITYENTITYATTLISTCONTENTELEMENTDOCTYPEXNodeXErrorXAttrXDTDXTagXPiXCdataXCmt XEntityRefXCharRefXTextXmlTreesXmlTree$f11$f16$f21$f9$f10$f12$f13$f14$f15$f17$f18$f19$f20 inputOptions relaxOptions outputOptionsgeneralOptionsversionOptions showOptions selectOptions removeOptions optionIsSetmkNode formatNTree foldNTreemapNTree nTreeToList depthNTree cardNTreetNameaNameAttrNameTagName XmlSFilter XmlFilter setNamespacexmlnsQNisNCNameisWellformedQualifiedNameisWellformedQNameisWellformedNSDeclisDeclaredNamespace mkElementNode mkAttrNode mkDTDNode mkElementmkRootmkAttr mkDTDElemaddAttr mergeAttrlXmlNodeisText isCharRef isEntityRefisCmtisCdataisPiisElemisRootisDTDisAttrisErrormkText mkCharRef mkEntityRefmkCmtmkCdatamkPimkErrorgetText getCharRef getEntityRefgetCmtgetCdata getPiName getPiContent getElemNamegetAttrl getDTDPart getDTDAttrl getAttrName getErrorLevel getErrorMsggetNamegetQualifiedNamegetUniversalNamegetUniversalUri getLocalPart getNamePrefixgetNamespaceUri changeText changeCmt changeNamechangeElemName changeAttrlchangeAttrName changePiNamechangeDTDAttrlsetTextsetCmtsetName setElemName setElemAttrl setAttrName setPiName setDTDAttrl :DXmlNode :TXmlNode $dmgetName$dmgetQualifiedName$dmgetUniversalName$dmgetUniversalUri$dmgetLocalPart$dmgetNamePrefix$dmgetNamespaceUri $dmsetText $dmsetCmt $dmsetName$dmsetElemName$dmsetElemAttrl$dmsetAttrName $dmsetPiName$dmsetDTDAttrl isXCdataNodeisXCharRefNode isXCmtNode isXDTDNode isXAttrNodeisXEntityRefNode isXErrorNode isXPiNode isXTagNode isXTextNode isRootNode isTagNode isOfTagNode isAttrNode isOfAttrNode isTextNode isOfTextNodeisPiNode isOfPiNode isDTDElemNode isErrorNode mkXTagTree mkQTagTree mkXNsTagTreenewRoot emptyRoot newDocument newDocument' mkRootTree mkXTextTreemkXCharRefTreemkXEntityRefTree mkXCmtTree mkXDTDTree mkXAttrTree mkQAttrTree mkXNsAttrTree mkXPERefTree mkXPiTree mkXmlDeclTree mkXCdataTree mkXErrorTreemaybeString2XText showXText showXCharRefshowXEntityRef showXErrorsxshowxmlTreesToStringxmlTreesToTextxmlContentModelToString showXmlTree showXmlTrees showXmlTrees' showQNameshowQuoteStringshowAttr showPEAttrshowExternalId showNData showXmlDTD showElemType showContent showEntityshowEntityValue showBlankshowEqshowLtshowGt showSlashshowAposshowQuotshowLparshowRparshowNLnameOf localPartOf namespaceOfprefixOfuniversalNameOf attrlOfDTD valueOfDTD ofDTDequalsxcmtxerrxwarnxtextxtagxattrtoTreeltoAttrl fromTreel fromAttrlisTagisNsTag hasLocalPart hasPrefix hasNamespaceisOfTaghasAttr hasNsAttrhasValueisXmlPiisOfPiisXCdata isXCharRefisXCmtisXDTD isXEntityRefisXErrorisXPiisXTagisXAttrisNsAttrisOfAttrisXTextisOfText isWhiteSpace isDoctype isAttlist isElementisEntityisPeRef isDTDName isCondSectisParameterEntity isNotationisDefaultAttrKindisEnumAttrTypeisFixedAttrKind isIdAttrTypeisIdRefAttrTypeisNotationAttrTypeisRequiredAttrKindisAttlistParameterEntityisEmptyElementisMixedContentElementisElemWithContentisAttlistOfElementisElemContentParamEntityisUnparsedEntityisExternalParameterEntityisInternalParameterEntity isWarning isFatalErrormkXTagmkQTagmkXNsTagmkXAttrmkQAttr mkXNsAttrmkXText mkXCharRef mkXEntityRefmkXCmtmkXDTDmkXCdatamkXPimkXErrorgetValue getNsValue getDTDValuegetXCmt getXCdata replaceQName modifyText modifyQName processAttrl processAttr replaceAttrldel1Attradd1AttraddAttrl addAttrInt modifyAttr addDTDAttr+=++=valueOf intValueOftagstagatagetagqetagqtagrootTagattrqattrsattrtxtcmtspicdatadtdwarnerrfatal hasOptionformatXmlContents formatXmlTreechangeSysState setSysState getSysStateinitialSysStatechangeSysStateAttrssetSysErrorHandlergetSysErrorHandlersetSysParamTree setSysParamsetSysParamIntsetSystemParamsgetSysParamTree getSysParamgetSysParamWithDefaultgetSysParamIntrun0run'chain'chainliftF setTraceLevel getTraceLeveltraceCmdtrace traceState clearStatus issueErrorerrorMsgHandlersetErrorMsgLevelerrorMsgToStderrerrorMsgLoggingerrorMsgLoggingAndToStderrerrClass issueWarnissueErr issueFataladdFatal checkStatus setStatusstatusOk checkResult processAttrMXmlStateFilterXStateXmlStatesysState userState SysStateAttrsSysState sysStateAttrssysStateErrorHandler $WXmlState $WSysState removeCommentremoveAllCommentremoveWhiteSpaceremoveAllWhiteSpacetransfAllCdataEscapedtransfCdataEscapedtransfAllCdata transfCdata transfCharReftransfAllCharRefcanonicalizeTreecanonicalizeAllNodescanonicalizeForXPath collapseXTextcollapseAllXText indentDocremoveDocWhiteSpace escapeXmlTextescapeXmlAttrValue escapeXmlDoc unparseXmlDoc addXmlPiToDocnumberLinesInXmlDoc numberLinestreeRepOfXmlDochaskellRepOfXmlDocaddHeadlineToXmlDocpropagateNamespacespropagateNamespaceEnvvalidateNamespacesvalidate1NamespacesisNamespaceDeclNamespaceTable putXmlDoc hPutXmlDocputXmlDocToFile hPutXmlTree putXmlTree hPutXmlSource putXmlSourcetraceFtraceMsg traceTree traceSourcepropagateAndValidateNamespaces setDefaultURIsPacesPace0skipSskipS0 asciiLetternamencNameqNamenmtokennamesnmtokens singleChar singleChars entityValue attrValue systemLiteral pubidLiteral referencecharRef entityRef peReferenceencName versionNumkeywordkeywordsquoteddqsqltgtsemi separatorbarcommaeqlparrparallButallBut1concResmkListnameTnmtokenT entityValueT entityTokensT entityCharT attrValueT attrValueT' singleCharsT referenceTcharRefT entityRefT peReferenceTgetFileContentsgetHttpContentsWithCurlgetHttpContentsWithHttpgetHttpContentsNativeOrWithCurlgetProtocolHandlerdtdDeclTokenizer dtdDeclStart dtdDeclEnddtdTokendtdCharspercentcharData charData'commentpIcDSectdocument document'prologxMLDeclxMLDecl' versionInfomisc doctypedecl markupdeclsDDeclelementcontentcontentWithTextDecltextDecl encodingDeclxreadparseXmlContent parseXmlTextparseXmlDocumentremoveEncodingSpec parseXmlPartparseXmlDTDPartparseXmlGeneralEntityValueparseXmlAttrValue parseNMToken parseNameparseXmlEncodingSpecparseXmlEntityEncodingSpecparseXmlDocEncodingSpec parseHtmlTextparseHtmlDocumentparseHtmlContentisEmptyHtmlTag emptyHtmlTagsisInnerHtmlTagOfsubstHtmlEntities parseXmlDocsubstXmlEntitiesgetXmlContentsgetXmlEntityContentsrunInLocalURIContextrunInNewURIContextguessDocEncoding setBaseURI getBaseURI getAbsolutURIisStandaloneDocumentgetUrlContentsgetContentLength getHtmlDoc parseHtmlDoc runHtmlParser isRelaxAnyURI compareURI normalizeURIisNumber isNmtokenisNameformatStringListPattformatStringListPairsformatStringListQuotformatStringListIdformatStringListArrformatStringList qn2String elementDecl attlistDecl entityDecl notationDeclparseXmlDTDEntityValueparseXmlDTDdeclPartparseXmlDTDdeclgetWellformedDoccheckWellformedDoc processDTDprocessGeneralEntitiescheckAttributeValuenormalizeAttributeValue validateDTDremoveDoublicateDefs transform validateDoc validateIdsvalidate getDTDSubsetgetValidatedDocgetXmlDocumentputXmlDocument parseDocument writeDocument parentAxis ancestorAxisancestorOrSelfAxis childAxisdescendantAxisdescendantOrSelfAxisfollowingSiblingAxisprecedingSiblingAxisselfAxis followingAxis precedingAxis attributeAxisvarEnvEnvKeyTabVarTab XPathFilterNodeSet NavXmlTrees NavXmlTree XPathValueXPVError XPVString XPVNumberXPVBoolXPVNodeConNodeConLenConPosContext FctArgumentsFctNameLiteralVarName LocalName NamePrefixName XPathNode XPTextNodeXPPINode XPCommentNodeXPNodeNodeTestTypeTestPINameTestAxisSpecSelfPrecedingSibling PrecedingParent NamespaceFollowingSibling FollowingDescendantOrSelf DescendantChild AttributeAncestorOrSelfAncestorXStepStepPathAbsRel LocationPathLocPathXPNumberPosInfPos0Neg0NegInfNaNFloatOpUnionUnaryMultModDivMinusPlus GreaterEqLessEqGreaterLessNEqEqAndOrExprFctExpr NumberExpr LiteralExprVarExpr FilterExprPathExprGenExpr$f22 toXPathTreexPValue2StringxPValue2XmlTreesexpr2XPathTree nt2XPathTreepred2XPathTree xPathUnary xPathMultixPathModxPathDivxPathAddrelaxSchemaFilerelaxSchemaGrammarFilea_relaxSimplificationChangescontextAttributescontextBaseAttr showDatatype notAllowed notAllowed1 notAllowed2 notAllowedNmergeNotAllowedgroup oneOrMore interleaveafter ContentTypeErrLevel ErrMessagePattern NameClassDatatypePrefix ParamListUri DatatypeCheck dtAllowsFct dtEqualFctdtAllowedTypesAllowedDatatypes AllowedParams ParamName DatatypeNameDatatypeLibraryDatatypeLibrariesDatatypeAllows DatatypeEqualRefListNamePairNewNameOldName isRelaxEmptyisRelaxNotAllowed isRelaxText isRelaxChoiceisRelaxInterleave isRelaxGroupisRelaxOneOrMore isRelaxList isRelaxDataisRelaxDataExcept isRelaxValueisRelaxAttributeisRelaxElement isRelaxAftergetChildrenPatterngetNameClassFromPatterngetPatternName rng_length rng_maxLength rng_minLengthrng_maxExclusiverng_minExclusiverng_maxInclusiverng_minInclusivealwaysOK alwaysErrorErrandCheckwithVal stringValid numberValid errorMsgEqualerrorMsgDataTypeNotAllowederrorMsgDataTypeNotAllowed0errorMsgDataTypeNotAllowed2errorMsgDataLibQNamew3cNS xsd_anyURI xsd_QName xsd_string xsd_NCName xsd_length xsd_maxLength xsd_minLength xsd_patternxsd_enumerationw3cDatatypeLibisScXsd isScFixedisScEnumisScElemisScAttr isScElemRef isScCharDataisScSAREisScListisScOptxsdParamscDTscDTxsdscString scString1scFixedscEnum scNmtoken scNmtokensscEmptyscSeqscSeqsscNullscAltscAltsscOptionscListscList1scOptscRepscElemscAttr DataTypeDescrdtLibdtNamedtParamsSchemasSchemasc_dtsc_nsc_lbsc_ubsc_1sc_l dtdDescrToXmlcheckAttrModellcheckAMcheckAMCcheckContentModell scContToXmlscWrapscContscConts scAttrToXmlcheckErrfoundErrdtdDescrelementDeclarations elementDecs elemNameselemNameelemRefsattrDec remAttrDecDTDdescrmysqlNSmysqlDatatypeLibdatatypeLibraries datatypeEqualdatatypeAllows parseNumber parseXPathxPValue2NodeSet emptyNodeSetstrictA ArrowState accessState nextState ArrowListarr2arr3arr4arr2AarrLarr2LconstAconstLisA>>.>.listA withDefaultsingleapplyA$<$<<$<<<$<<<<$<$performcatAseqAArrowIfifAifPwhenPwhenNotPguardsPchoiceAtagAspanA partitionA :DArrowIf $p1ArrowIf :TArrowIf$dmifP$dmneg$dmwhen$dmwhenP $dmwhenNot $dmwhenNotP $dmguards $dmguardsP $dmcontaining$dmnotContaining $dmchoiceA$dmtagA$dmspanA $dmpartitionA ArrowTreeprocessBottomUpWhenNotinsertTreeTemplatefromLALArunLAfromSLASLArunSLA ArrowIOIfisIOAArrowIOarrIOarrIO0arrIO2arrIO3arrIO4IOLArunIOLAliftStrunStIOSLArunIOSLAArrowDTD isDTDDoctype isDTDElement isDTDContent isDTDAttlist isDTDEntity isDTDPEntity isDTDNotation isDTDCondSect isDTDPERef hasDTDAttrgetDTDAttrValuesetDTDAttrValue mkDTDDoctype mkDTDElement mkDTDEntity mkDTDPEntityArrowXmlhasText hasNameWithhasQNamehasName hasNamePrefixhasNamespaceUrihasQAttr hasAttrValue hasQAttrValuemkqelemmkelemaelemselemeelemrootsqattrgetQName getAttrValue getAttrValue0 getQAttrValuegetQAttrValue0 changeQNamechangeAttrValuesetQNamesetAttrl removeAttr removeQAttrprocessTopDownWithAttrl :DArrowDTD :DArrowXml $p1ArrowDTD $p1ArrowXml $p2ArrowXml $p3ArrowXml :TArrowDTD :TArrowXml$dmisDTDDoctype$dmisDTDElement$dmisDTDContent$dmisDTDAttlist$dmisDTDEntity$dmisDTDPEntity$dmisDTDNotation$dmisDTDCondSect $dmisDTDName $dmisDTDPERef $dmhasDTDAttr$dmgetDTDAttrValue$dmsetDTDAttrValue $dmmkDTDElem$dmmkDTDDoctype$dmmkDTDElement$dmmkDTDEntity$dmmkDTDPEntity $dmisText $dmisCharRef$dmisEntityRef$dmisCmt $dmisCdata$dmisPi $dmisXmlPi $dmisElem$dmisDTD $dmisAttr $dmisError $dmisRoot $dmhasText$dmisWhiteSpace$dmhasNameWith $dmhasQName $dmhasName$dmhasLocalPart$dmhasNamePrefix$dmhasNamespaceUri $dmhasAttr $dmhasQAttr$dmhasAttrValue$dmhasQAttrValue $dmmkText $dmmkCharRef$dmmkEntityRef$dmmkCmt $dmmkCdata $dmmkError $dmmkElement $dmmkAttr$dmmkPi $dmmkqelem $dmmkelem$dmaelem$dmselem$dmeelem$dmroot$dmqattr$dmattr$dmtxt $dmcharRef $dmentityRef$dmcmt$dmwarn$dmerr$dmfatal$dmspi $dmsqattr$dmsattr $dmgetText $dmgetCharRef$dmgetEntityRef $dmgetCmt $dmgetCdata $dmgetPiName$dmgetPiContent$dmgetElemName $dmgetAttrl $dmgetDTDPart$dmgetDTDAttrl$dmgetAttrName$dmgetErrorLevel$dmgetErrorMsg $dmgetQName$dmgetAttrValue$dmgetAttrValue0$dmgetQAttrValue$dmgetQAttrValue0 $dmchangeText $dmchangeCmt$dmchangeQName$dmchangeElemName$dmchangeAttrName$dmchangePiName$dmchangeAttrValue$dmchangeAttrl $dmsetQName $dmsetAttrl $dmaddAttrl $dmaddAttr $dmremoveAttr$dmremoveQAttr$dmprocessAttrl$dmprocessTopDownWithAttrl$dm+=$dmxshowcanonicalizeContents escapeHtmlDochasXmlPiaddXmlPiaddXmlPiEncodingaddXHtmlDoctypeStrictaddXHtmlDoctypeTransitionaladdXHtmlDoctypeFramesetaddDoctypeDeclisNamespaceDeclAttrgetNamespaceDeclcollectNamespaceDeclcollectPrefixUriPairsuniqueNamespaces!uniqueNamespacesFromDeclAndQNamescleanupNamespacesprocessWithNsEnvprocessWithNsEnvWithoutAttrl attachNsEnv transformDocsubstHtmlEntityRefssubstXmlEntityRefssubstEntityRefsemptyStaddAttaddContdropContgetAtt pickleDoc unpickleDocxpZeroxpUnitxpLift xpLiftMaybe xpCondSeqxpSeqxpChoicexpWrap xpWrapMaybexpPairxpTriplexp4Tuplexp5TuplexpTextxpTextDTxpText0 xpText0DTxpPrimxpTreexpOptionxpListxpList1xpAltxpElemxpAttr xpAttrImplied xpAttrFixedxpAddFixedAttr XmlPicklerxpicklePU appPickle appUnPickle theSchemaSt attributescontents hasRngName checkRngName noOfChildrenisAttributeRef3isAttributeRefTextListGroupInterleaveOneOrMoreEmpty isAttributeRefTextListInterleave'isAttributeListGroupInterleaveOneOrMoreisExternalRefIncludeisNameNsNameValue isNameNsNameisNameAnyNameNsName,isDefineOneOrMoreZeroOrMoreOptionalListMixedisChoiceGroupInterleave isChoiceGroupInterleaveOneOrMoreisGroupInterleave isRngAnyNameisRngAttribute isRngChoice isRngCombine isRngData isRngDefineisRngDiv isRngElement isRngEmpty isRngExceptisRngExternalRef isRngGrammar isRngGroup isRngIncludeisRngInterleave isRngList isRngMixed isRngNameisRngNotAllowed isRngNsNameisRngOneOrMore isRngOptional isRngParamisRngParentRefisRngRefisRngRelaxError isRngStart isRngText isRngType isRngValueisRngZeroOrMore mkRngElement mkRngChoice mkRngDefine mkRngEmpty mkRngGrammar mkRngGroupmkRngInterleave mkRngNamemkRngNotAllowedmkRngOneOrMoremkRngRefmkRngRelaxError mkRngStart mkRngText setRngName setRngNameDiv setRngNameRefisRngAttrAttributeisRngAttrCombineisRngAttrDatatypeLibrary isRngAttrHref isRngAttrName isRngAttrNs isRngAttrTypehasRngAttrAttributehasRngAttrCombinehasRngAttrDatatypeLibraryhasRngAttrHrefhasRngAttrName hasRngAttrNshasRngAttrTypegetRngAttrAttributegetRngAttrCombinegetRngAttrDatatypeLibrarygetRngAttrDescrgetRngAttrHrefgetRngAttrName getRngAttrNsgetRngAttrTypecreatePatternFromXmlTreecreateNameClass firstChild lastChildxmlTreeToPatternStringnameClassToStringpatternToStringTreexmlTreeToPatternStringTreexmlTreeToPatternFormatedStringpatternToFormatedStringrelaxSchemaArrowrelaxSchemaTree initialStaterunX getUserStatechangeUserState setUserStatewithExtendedUserStatewithOtherUserStatechangeSysParamsetParam setParamList unsetParamgetParam getAllParamssetParamStringgetParamString setParamInt getParamIntclearErrStatus setErrStatus getErrStatussetErrMsgStatussetErrorMsgHandlererrorMsgStderrerrorMsgCollecterrorMsgStderrAndCollecterrorMsgIgnoregetErrorMessagesfilterErrorMsgsetDocumentStatus setDocumentStatusFromSystemStatedocumentStatusOk changeBaseURIsetDefaultBaseURIgetDefaultBaseURIwithTraceLevel traceStringtraceDocexpandURIString expandURImkAbsURIgetSchemeFromURIgetRegNameFromURIgetPortFromURIgetUserInfoFromURIgetPathFromURIgetQueryFromURIgetFragmentFromURIIOSArrow IOStateArrowXIOState xio_sysState xio_userState XIOSysStateXIOSys xio_tracexio_errorStatusxio_errorModulexio_errorMsgHandlerxio_errorMsgCollectxio_errorMsgList xio_baseURIxio_defaultBaseURI xio_attrListgetURIContents getEncodingdecodeDocumentvalidateDocumentgetDocumentContents validateWithRelaxAndHandleErrorsnormalizeForRelaxValidationvalidateDocWithRelax validateRelax readForRelaxvalidateXMLDoccontains getErrorscreateSimpleFormvalidateDocumentWithRelaxSchemavalidateDocumentWithRelaxvalidateSchemavalidateWithSpezificationvalidateSchemaWithSpezificationvalidateWithoutSpezification readDocumentreadFromDocument readStringreadFromStringhread getKeyTab getVarTab getConvFctcreateDocumentOrdercreateDocumentOrderReverseremDupsisNotInNodeListevalFcttoXValue stringValuexstringxbooleanxnumberXFctgetXPathgetXPathWithNsEnvgetXPathSubTreesgetXPathSubTreesWithNsEnvgetXPathNodeSetgetXPathNodeSetWithNsEnvevalExprgetXPathTreesInDocgetXPathTreesInDocWithNsEnv getXPathTreesgetXPathTreesWithNsEnvgetElemNodeSetgetElemAndAttrNodeSetgetFromNodeSetprocessXPathTreesprocessXPathTreesWithNsEnvprocessFromNodeSet mapTreeCtx filterTree filterTreeCtx zipTreeWithzipTree unzipTree showTreescollectTextnodes isElemType isAttrTypetryFetchAttributefetchAttributeWDefaultfetchAttribute hasAttribute setAttributeisWhitespaceNodemkQNamemkExNameexLocalexUri parseExName getUriMap setUriMap uriMap2Attrs lookupPrefix expandNSDecls mkLiteralExpr mkStringExpr mkBoolExpr mkTrueExpr concatExpr splitExpr unionExprsplitMatchByPriocomputePrioritycomputeNTestPriority isMatchExpr fromJustErr readWDefault UriMappingExName xsltPrefixxsltUri mkXsltNamemkXsltAttribNamexsltStylesheet xsltSelectxsltVersionLRExmlSpace getMatchRules getNamedRules getVariablesgetAttributeSets getStrips getAliases getRulePrio getRuleModegetRuleImports getRuleName getVarNameisParam parseNTest lookupStrip lookupStrip1 feedSpaces feedPreserves stripDocumentstripStylesheet stripSpacesaddAlias lookupAliasaliasUriMapping MatchExpr StringExprTestExpr SelectExpr ComputedQNameWhenSortKeyTemplate NSAliasingStripsNTest AttributeSetUsedAttribSetsVariable NamedRule MatchRuleCompiledStylesheetapplyStylesheetWParamsapplyStylesheet XPathParamsassembleStylesheetprepareXSLTDocumentxsltCompileStylesheetxsltCompileStylesheetFromURIxsltApplyStylesheetxsltApplyStylesheetFromURIgetOutputEncodingencodeDocumentwriteDocumentToStringxpickleDocumenta_addDTDxunpickleDocumentxpickleWriteDTD xpickleDTD checkPickler xpickleVal xunpickleVal thePicklerDTD a_ancestor a_attributea_child a_descendanta_descendant_or_self a_followinga_following_sibling a_namespacea_parent a_precedinga_preceding_siblinga_self n_commentn_processing_instructionn_noderem_rept_xmla_canonicalizea_check_namespacesa_collect_errorsa_columna_contentLengtha_default_baseuria_do_not_canonicalizea_do_not_check_namespacesa_do_not_issue_errorsa_do_not_issue_warningsa_do_not_preserve_commenta_do_not_remove_whitespacea_do_not_use_curla_do_not_validate a_encodinga_error a_error_loga_helpa_indenta_issue_warningsa_issue_errorsa_kinda_linea_module a_modifiera_name a_no_xml_pia_options_curl a_output_filea_output_encoding a_output_html a_output_xml a_parse_html a_parse_xmla_perefa_preserve_commenta_propagate_errorsa_proxya_remove_whitespacea_show_haskell a_show_treea_source a_standalonea_statusa_tracea_typea_url a_use_curl a_validatea_value a_verbose a_versiona_xmla_xmlnsv_yesv_nov_0v_any v_childrenv_choicev_emptyv_pcdatav_mixedv_seqv_nullv_optionv_starv_plusk_anyk_empty k_enitity k_entitiesk_idk_idrefk_idrefs k_includek_ignore k_nmtoken k_nmtokensk_perefk_publick_system k_enumerationk_fixed k_impliedk_ndata k_notationk_pcdata k_required k_defaulttransferPrefixtransferVersiontransferMimeTypetransferEncodingtransferDefaultURItransferStatustransferMessage transferURI isoLatin1 iso8859_2 iso8859_3 iso8859_4 iso8859_5 iso8859_6 iso8859_7 iso8859_8 iso8859_9 iso8859_10 iso8859_11 iso8859_13 iso8859_14 iso8859_15 iso8859_16usAsciiucs2utf8utf16utf16beutf16le unicodeStringa_relax_schemaa_check_restrictionsa_do_not_validate_externalRefa_validate_externalRefa_do_not_validate_includea_validate_includea_output_changesa_do_not_collect_errorsis1ByteXmlChar decodeAsciiescapeTrue decodingTabledecodingTableEmbedErrorsoutputEncodingTable escapeString collectText substPEref'substParamEntity mergeDTDs checkValuecheckValueEnumerationcheckValueEntitycheckValueEntitiescheckValueNmtokencheckValueNmtokens checkValueIdcheckValueIdrefcheckValueIdrefs checkForNamecdataNormalizationotherNormalizationreduceWSSequencesgetXTextValuesvalidateNotationsvalidateEntitiesvalidateElementsvalidateAttributes traverseTreebuildAllTransformationFunctionsbuildTransRootbuildTransformationFunctionslexicographicAttributeOrdernormalizeAttributeValuessetDefaultAttributeValues TransEnvTablebuildAllValidationFunctionsbuildValidateRootbuildValidateFunctionsbuildContentValidationcreateREbuildAttributeValidationnoDoublicateAttributescheckRequiredAttributescheckFixedAttributescheckNotDeclardAttributescheckValuesOfAttributes ValiEnvTable getIdValuebuildIdCollectorFctsbuildIdrefValidationFctscheckForUniqueIdscheckIdReferences IdEnvTableprocessDocument xPathSpeza_numberOfErrorsdefineOrigNameCTNoneCTSimple CTComplexCTEmptyErrMsgAfterElementValue DataExceptDataList OneOrMoreGroup InterleaveChoiceText NotAllowedEmptyNCErrorNameClassChoice NsNameExceptNsName AnyNameExceptAnyNameDTC fctTableNumfctTableString numParamValid errorMsgParam FunctionTable w3cDatatypes stringParamsdatatypeAllowsW3CdatatypeEqualW3CDTDescrCharDataElemRefRepAltSeqAnymysqlDatatypes stringTypes numericTypes numericParamsdatatypeAllowsMysqldatatypeEqualMysqlrelaxDatatypeLib'relaxDatatypesdatatypeEqualRelax<+>>>>span partitioncanonicalizeTree'EntityRefTableprocessWithNsEnv1arrfirstapp|||loop&&&***secondpureArrow runKleisliKleisli zeroArrow ArrowZero ArrowPlusrightleft ArrowChoice ArrowApply ArrowMonad ArrowLoopleftApp^<<<<^<<<>>^^>>returnAcreatePatternFromXml mkRelaxRef mkNotAllowed mkRelaxError mkRelaxChoicemkRelaxInterleave mkRelaxGroupmkRelaxOneOrMore mkRelaxList mkRelaxData mkRelaxValuemkRelaxAttributemkRelaxElementchangeErrorStatus sysErrorMsggetPartFromURIString childDeriv textDeriv listDerivstartTagOpenDeriv attsDerivstartTagCloseDeriv childrenDeriv endTagDeriv applyAftergetRefsFromStartPatternfctTable documentPosxlast xpositionxcountxidgetIds xlocalName xnamespaceUrixname getFirstPosxconcat xstartsWith xcontainsxsubstringBeforexsubstringAfter xsubstring xstringLengthxnormalizeSpace xtranslatexnotxtruexfalsexlangxsumxfloorxceilingxroundxkey xformatNumber IdPathStep CheckArgCount FctTableElemFctTablegetXPathValues filterEval unionEval relEqEval relEqTwoNodes relEqOneNodeeqEvgetRoot getAxisNodesaxisFctL locPathEvalevalStepnodeTesttypeTest filterNodesboolEval getVariablefctEvalnumEvalidAttributesToXPathValuegetIdAttributes xsltTransform xsltMessage xsltForEach xsltChoosexsltWhen xsltOtherwisexsltIf xsltElement xsltAttributexsltText xsltValueOf xsltComment xsltProcInstr xsltInclude xsltImport xsltTemplatexsltApplyTemplatesxsltApplyImportsxsltCallTemplate xsltVariable xsltParam xsltWithParamxsltAttributeSetxsltCopy xsltCopyOfxsltSortxsltStripSpacexsltPreserveSpacexsltNamespaceAlias xsltTerminatexsltTestxsltName xsltNamespacexsltUseAttributeSetsxsltHRef xsltMatch xsltPriorityxsltMode xsltDataType xsltOrder xsltElementsxsltStylesheetPrefixxsltResultPrefix xsltVersionxsltExlcudeResultPrefixesxsltExtensionElementPrefixesxsltUseAttributeSetsLRExsltExlcudeResultPrefixesLRExsltExtensionElementPrefixesLRE feedStrips CompQName LiteralQNameWhenPartSortK TemplCopyOf TemplCopy TemplCall TemplVariableTemplApplyImports TemplApplyTemplProcInstr TemplComment TemplValueOf TemplTextTemplAttribute TemplElement TemplMessage TemplChoose TemplForEachTemplComposite AttribSetMkVarNamRuleMatRuleCompStylesheet arrWithCatchprepareXSLTDoc readXSLTDoccompileSSTWithIncludeStackreadSSTWithIncludeStack