R=      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ portable experimentalUwe Schmidt (uwe@fh-wedel.de)     #'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 *converts a n-ary tree in a navigable tree *converts a navigable tree in a n-ary tree >function for selecting the value of the current fragment tree .function for selecting all children of a tree position of tree in parent (path (index list) of a navigatable tree  !"#$%Kleisli composition: &'()*+,-./0123& !"#$%&'()*+,-./0123#! "#$%&'()*+,-./0123# !"#$%&'()*+,-./0123portable experimentalUwe Schmidt (uwe@fh-wedel.de)g456XPath environment -All variables are stored in the environment, ) each variable name is bound to a value. 7AA functions that takes a XPath result and returns a XPath result 85path represented as list of indices starting at root 9HSet of navigable trees identified by their document position (NodePath) :;</List of nodes of navigable tree representation =&Node of navigable tree representation >Represents XPath results ?error message with text @ string value A'number according the IEEE 754 standard Bboolean value C node-set D Context node EContext length FContext position GEvaluation context HFunction arguments IFunction name J a string KVariable name LMNORepresents nodetype-tests P"text-nodes: cdata, character data Qprocessing-instruction-nodes Rcomment-nodes Sall 7 nodetypes ; (root, element, attribute, namespace, pi, comment, text) TRepresents XPath node-tests Uall nodetype-tests V4processing-instruction-test with a literal argument W name-test XRepresents XPath axis YZ[\]^_`abcdefRepresents location step NA location step consists of an axis, a node-test and zero or more predicates. gh:A location path is either a relative or an absolute path. ijkRepresents location path FA location path consists of a sequence of one or more location steps. lmCRepresents 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. npositive infinity opositive zero pnegative zero qnegative infinity r not-a-number sfloating-point number tRepresents XPath operators uvwxyz{|}~Represents expression 9a function with a name and an optional list of arguments number string  variable /filter-expression with zero or more predicates 9a path expression contains an optional filter-expression 9 or an optional locationpath. one expression is urgently  necessary, both are possible =generic expression with an operator and one or more operands node set functions  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~gt~}|{zyxwvumsrqponklhjifgXedcba`_^]\[ZYTWVUOSRQPNMLKJIHGFED>CBA@?=<9:;87654g456789:;:;<=>CBA@??@ABCDEFGHIJKLMNOSRQPPQRSTWVUUVWX edcba`_^]\[ZYYZ[\]^_`abcdefgghjiijkllmsrqponnopqrst~}|{zyxwvuuvwxyz{|}~Unary minus: the value r- 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 (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 JConvert 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. portable experimentalUwe Schmidt (uwe@fh-wedel.de)<)parsing a number, parseNumber is used in XPathFct  by the number function  returns : the parsed number as m float  or A r in case of error the main entry point:  parsing a XPath expression      portable experimentalUwe Schmidt (uwe@fh-wedel.de)Tcalculate 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.  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. PCheck whether a node is not a part of a node list. Needed to implement matching & testing in xslt. !"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 > Converts a list of different > types in a list of one > 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 &9node-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?): R returns the local part of the expanded-name of the node in the argument node-set " that is first in document order. h 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?): U returns the namespace URI 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, the first node has no expanded-name, + or the namespace URI of the expanded-name C is null, an empty string is returned. If the argument is omitted, D it defaults to a node-set with the context node as its only member ,string name(node-set?): P returns a string containing a QName representing the expanded-name of the node  in the argument node-set Q that is first in document order. If the argument node-set is empty or the first  node has no expanded-name, T 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 0Sstring concat(string, string, string*): returns the concatenation of its arguments 1%boolean starts-with(string, string): 2 returns true if the first argument string starts > with the second argument string, and otherwise returns false 2"boolean contains(string, string): P returns true if the first argument string contains the second argument string,  and otherwise returns false 3)string substring-before(string, string): Z returns the substring of the first argument string that precedes the first occurrence of  the second argument string Y in the first argument string, or the empty string if the first argument string does not $ contain the second argument string 45(string substring-after(string, string): Y returns the substring of the first argument string that follows the first occurrence of  the second argument string Y in the first argument string, or the empty string if the first argument string does not $ contain the second argument string 67+string substring(string, number, number?): P returns the substring of the first argument starting at the position specified  in the second argument V 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. 89number string-length(string?): M 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?): M returns the argument string with whitespace normalized by stripping leading 1 and trailing whitespace and replacing sequences I of whitespace characters by a single space. If the argument is omitted, 8 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 Aboolean false(): returns false Bboolean lang(string): q 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 Cnumber sum(node-set): K 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 Ddnumber floor(number): returns the largest (closest to positive infinity) number that is not greater * than the argument and that is an integer Ednumber ceiling(number): returns the smallest (closest to negative infinity) number that is not less * than the argument and that is an integer Fnumber round(number): L 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. GHnode-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 IJKLMN/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 OPQRSTUVWXY portable experimentalUwe Schmidt (uwe@fh-wedel.de) Z'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 [ ^_` portable experimentalUwe Schmidt (uwe@fh-wedel.de)?abHSelect parts of a document by a string representing a 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 converted to text nodes. ASelect parts of a document by an already parsed XPath expression BSelect parts of a document by a namespace aware XPath expression.  Works like 8 but the prefix:localpart names in the XPath expression A are interpreted with respect to the given namespace environment JSelect parts of an XML tree by a string representing an 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. 4Select parts of an XML tree by an XPath expression. Same as + but with namespace aware XPath expression 'compute the node set of an XPath query Hcompute the node set of an XPath query for an already parsed XPath expr 6compute the node set of a namespace aware XPath query c5parse xpath, evaluate xpath expr and prepare results de5parse xpath, evaluate xpath expr and prepare results parse an XPath expr string . and return an expr tree or an error message. ( Namespaces are not taken into account. ^parse an XPath expr string with a namespace environment for qualified names in the XPath expr - and return an expr tree or an error message !The main evaluation entry point.  Each XPath-* is mapped to an evaluation function. The 40-parameter contains the set of global variables  for the evaluator, the GF-parameter the root of the tree in which the expression is evaluated. fgh*filter for evaluating a filter-expression iHreturns the union of its arguments, the arguments have to be node-sets. jOEquality or relational test for node-sets, numbers, boolean values or strings, 4 each computation of two operands is done by relEqEv' kl/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 m2Comparison 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. nFNo 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. op9Filter for accessing the root element of a document tree qrstuvw/Filter for accessing all nodes of a XPath-axis " 1.parameter as : axis specifier xAxis-Function-Table. H Each XPath axis-specifier is mapped to the corresponding axis-function yevaluates a location path, = evaluation of an absolute path starts at the document root, ' the relative path at the context node z{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 :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 *tests whether a node is of a special type =evaluates a boolean expression, the evaluation is non-strict  returns the value of a variable evaluates a function,  computation is done by XPathFct.evalFct which is defined in XPathFct. #evaluates an arithmetic operation. (parameter f : arithmetic function from XPathArithmetic >Convert list of ID attributes from DTD into a space separated @ DExtracts all ID-attributes from the document type definition (DTD).  portable 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  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 4 but with namespace environment for the XPath names =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. Same as 4 but with namespace environment for the XPath names HSelect 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  or . 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. Same as 4 but with namespace environment for the XPath names Ucompute 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") Ocompute a node set from a tree, containing all nodes including attribute nodes  elected by the predicate arrow @select all subtrees specified by a previously computed node set the following law holds: / getFromNodeSet $< getElemNodeSet f == multi f 5process all subtrees selected by an XPath expression the following law holds: T processXPathTrees p xpathExpr == processFromNodeSet p $< getXPathNodeSet xpathExpr Same as 4 but with namespace environment for the XPath names Uprocess all subtrees specified by a previously computed node set in bottom up manner the following law should hold:  J processFromNodeSet g $< getElemNodeSet f == processBottomUp (g `when` f) 3when attributes are contained in the node set (see ), 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.  !   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn o p q r s t u v w x y z { | } ~                                      hxt-xpath-9.1.2 Text.XML.HXT.XPath.XPathKeywordsText.XML.HXT.XPath.NavTree!Text.XML.HXT.XPath.XPathDataTypes"Text.XML.HXT.XPath.XPathArithmetic!Text.XML.HXT.XPath.XPathToNodeSetText.XML.HXT.XPath.XPathParserText.XML.HXT.XPath.XPathFct Text.XML.HXT.XPath.XPathToStringText.XML.HXT.XPath.XPathEvalText.XML.HXT.XPath.ArrowsText.XML.HXT.XPath a_ancestora_ancestor_or_self a_attributea_child a_descendanta_descendant_or_self a_followinga_following_sibling a_namespacea_parent a_precedinga_preceding_siblinga_self n_commentn_textn_processing_instructionn_nodeNavTreeNTself selfIndex ancestorspreviousSiblingsfollowingSiblingsntree subtreeNTdataNT childrenNTindexNTpathNTupNTdownNTleftNTrightNT preorderNT revPreorderNT getChildrenNTo' maybeStar maybePlus parentAxis ancestorAxisancestorOrSelfAxis childAxisdescendantAxisdescendantOrSelfAxisfollowingSiblingAxisprecedingSiblingAxisselfAxis followingAxis precedingAxis attributeAxisEnvKeyTabVarTab XPathFilterNodePathNodeSetNSunNS NavXmlTrees NavXmlTree XPathValueXPVError XPVString XPVNumberXPVBoolXPVNodeConNodeConLenConPosContext FctArgumentsFctNameLiteralVarName LocalName NamePrefixName XPathNode XPTextNodeXPPINode XPCommentNodeXPNodeNodeTestTypeTestPINameTestAxisSpecSelfPrecedingSibling PrecedingParent NamespaceFollowingSibling FollowingDescendantOrSelf DescendantChild AttributeAncestorOrSelfAncestorXStepStepPathAbsRel LocationPathLocPathXPNumberPosInfPos0Neg0NegInfNaNFloatOpUnionUnaryMultModDivMinusPlus GreaterEqLessEqGreaterLessNEqEqAndOrExprFctExpr NumberExpr LiteralExprVarExpr FilterExprPathExprGenExpr withXPVNode emptyNodeSetsingletonNodeSet nullNodeSet cardNodeSet deleteNodeSet insertNodeSet unionNodeSet unionsNodeSet elemsNodeSet fromNodeSet toNodeSet headNodeSet withNodeSetvarEnv xPathUnary xPathMultixPathModxPathDivxPathAddxPValue2XmlNodeSetemptyXmlNodeSet parseNumber parseXPathXFct getKeyTab getVarTab getConvFctisNotInNodeListevalFcttoXValue stringValuexstringxbooleanxnumber toXPathTreeformatXPathTreexPValue2StringxPValue2XmlTreesexpr2XPathTree nt2XPathTreepred2XPathTreegetXPath getXPath'getXPathWithNsEnvgetXPathSubTreesgetXPathSubTrees'getXPathSubTreesWithNsEnvgetXPathNodeSet'getXPathNodeSet''getXPathNodeSetWithNsEnv'addRoot'parseXPathExprparseXPathExprWithNsEnvevalExprgetXPathTreesInDocgetXPathTreesInDocWithNsEnv getXPathTreesgetXPathTreesWithNsEnvgetXPathNodeSetgetElemNodeSetgetElemAndAttrNodeSetgetFromNodeSetprocessXPathTreesprocessXPathTreesWithNsEnvprocessFromNodeSet hxt-9.2.0Data.Tree.NTree.TypeDefsNTreeNTrees xPathSpez leafNodeSet toNodeSet'toPathupTreepathListToNodeSet XPathParserlookupNsenhanceAttrQName enhanceQName enhanceQN parseNumber'lparrparlbrarbraslashdslash tokenParser symbolParsersymbolorOpandOpeqOprelOpaddOpmultiOpunionOp mkExprNodeexprRestdescOrSelfSteplocPath absLocPath relLocPath' relLocPathstep'stepaxisSpecifier' axisSpecifiernodeTestpI predicateabbrStepexpr primaryExpr functionCall unionExprpathExpr filterExprorExprandExpr equalityExprrelationalExpr additiveExprmultiplicativeExpr unaryExprliteralnumber functionNamevariableReferencenameTest enhanceName nodeType'nodeType IdPathStepIdAttrIdPosIdRoot CheckArgCount FctTableElemFctTable int2XPNumberzero zeroOrOneonetwotwoOrM twoOrThreethreefctTablenodeIDnodeID'xlast xpositionxcountxidgetIdsisInIdfilterNS xlocalName xnamespaceUrixname getFirstPos getFirstPos' strStartsWithxconcat xstartsWith xcontainsxsubstringBeforexsubstringBefore'xsubstringAfterxsubstringAfter' xsubstring xsubstring' xstringLengthxnormalizeSpacenormStr xtranslate xtranslate'replacexnotxtruexfalsexlangxsumxfloorxceilingxroundxround'xkeyisInKey isKeyNameisKeyVal isOfKeyName isOfKeyValue xformatNumber xdocument xdocument' xgenerateId xgenerateId' str2XmlId xpNamePart xpLocalPartOf xpNamespaceOfxpNameOfgetValuexpTextOf XPathTreeText.XML.HXT.DOM.FormatXmlTree formatXmlTreextextxerrlocpath2XPathTreestep2XPathTreetypeTest2String NodeListResNodeListgetXPathValuesxPathErrgetXPathValues' evalExprL evalSpezExpr filterEval unionEval relEqEvalrelEqEv' relEqTwoNodes relEqOneNodeeqEvgetOpFctgetRootnodeListResToXPathValuenullNLplusNLsumNLmapNLmapNL' getAxisNodesaxisFctL locPathEval evalStepsevalStepevalAttrevalAttrNodeTest evalStep' evalStep'' evalPredLevalPred evalPred' testPredicate nodeTest' filterNodes' wildcardTesttypeTestboolEval getVariablefctEvalnumEvalidAttributesToXPathValuegetIdAttributes isIdAttrType valueOfDTDhasDTDAttrValueText.XML.HXT.Arrow.EditcanonicalizeForXPathgetXPathNodeSetWithNsEnv getNodeSetgetFromNodeSet'processFromNodeSet'