WB      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Copyright (C) 2010 Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportable Safe-Inferred     None&navigable tree with nodes of type nodea 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 treeposition of tree in parent'path (index list) of a navigatable tree%Kleisli composition:# !"#$%&'()*+,-./0123& !"#$%&'()*+,-./0123#! "#$%&'()*+,-./0123 !"#$%&'()*+,-./0123Copyright (C) 2006 Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone26XPath environmentUAll variables are stored in the environment, each variable name is bound to a value.7@A functions that takes a XPath result and returns a XPath result84path represented as list of indices starting at root9GSet 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 valueA&number according the IEEE 754 standardB boolean valueCnode-setD Context nodeEContext lengthFContext positionGEvaluation contextHFunction argumentsI Function nameJa stringK Variable nameORepresents nodetype-testsP!text-nodes: cdata, character dataQprocessing-instruction-nodesR comment-nodesSJall 7 nodetypes (root, element, attribute, namespace, pi, comment, text)TRepresents XPath node-testsUall nodetype-testsV3processing-instruction-test with a literal argumentW name-testXRepresents XPath axisfRepresents location stepMA location step consists of an axis, a node-test and zero or more predicates.h9A location path is either a relative or an absolute path.kRepresents location pathEA location path consists of a sequence of one or more location steps.mBRepresents a floating-point number according the IEEE 754 standardvThe standard includes a special Not-a-Number (NaN) value, positive and negative infinity, positive and negative zero.npositive infinityo positive zerop negative zeroqnegative infinityr not-a-numbersfloating-point numbertRepresents XPath operatorsRepresents expression8a function with a name and an optional list of argumentsnumberstringvariable.filter-expression with zero or more predicatesa path expression contains an optional filter-expression or an optional locationpath. one expression is urgently necessary, both are possible<generic expression with an operator and one or more operandsnode set functionsl456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~lt~}|{zyxwvumsrqponklhjifgXedcba`_^]\[ZYTWVUOSRQPNMLKJIHGFED>CBA@?=<9:;876541456789:;<=>CBA@?DEFGHIJKLMNOSRQPTWVUX edcba`_^]\[ZYfghjiklmsrqpont~}|{zyxwvuNoneUnary minus: the value rM is not calculatable and returned unchanged, all other values can be denied.MultiplicationModuloDivision: the divison-operator is not according the IEEE 754 standard, it calculates the same as the % operator in Java and ECMAScriptPlus and minus 'parameter op : plus or minus operationtIdentically results of the operators are combined to get as few as possible combinations of the special IEEE valuesNoneIConvert a a XPath-value into a XmlNodeSet represented by a tree structureKThe XmlNodeSet can be used to traverse a tree an process all marked nodes.3Copyright (C) 2006-2010 Uwe Schmidt, Torben KuselerMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone)parsing a number, parseNumber is used in XPathFct by the number functionreturns : the parsed number as m float or A r in case of error1the main entry point: parsing a XPath expression<     <     Copyright (C) 2008 Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone,calculate an ID for a NODEBreturns : a list of numbers, one number for each level of the treeATests whether the number of current function arguments is correctNEach table entry consists of the function and the expected function arguments.-All functions are stored in a function table.GType 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 environment3Returns the table of variables from the environmentrReturns the conversion function for the XPath results: string, boolean and number A nodeset can not be converted.bCheck whether a node is not a part of a node list. Needed to implement matching & testing in xslt.Evaluates a function. 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`number last(): returns a number equal to the context size from the expression evaluation contexthnumber position(): returns a number equal to the context position from the expression evaluation contextLnumber count(node-set): returns the number of nodes in the argument node-set8node-set id(object): selects elements by their unique IDoreturns all IDs from the variable environment as a list of strings. the IDs are stored in the variable: idAttr Ystring local-name(node-set?): returns the local part of the expanded-name of the node in the argument node-set 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 is omitted, it defaults to a node-set with the context node as its only member!string namespace-uri(node-set?): returns the namespace URI of the expanded-name of the node in the argument node-set that is first in document order. 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?): returns a string containing a QName representing the expanded-name of the node in the argument node-set 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 functionsSReturns the string-value of a node, the value of a namespace node is not supported6string string(object?): converts an object to a string$Rstring concat(string, string, string*): returns the concatenation of its arguments%boolean starts-with(string, string): returns true if the first argument string starts with the second argument string, and otherwise returns false&boolean contains(string, string): returns true if the first argument string contains the second argument string, and otherwise returns false'string substring-before(string, string): 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): 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)fstring substring(string, number, number?): returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string.*number string-length(string?): returns the number of characters in the string. If the argument is omitted, it defaults to the context node 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, in other words the string-value of the context node. 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 the corresponding position in the third argument stringAboolean boolean(object): converts its argument to a boolean value-Pboolean not(boolean): returns true if its argument is false, and false otherwise.boolean true(): returns true/boolean false(): returns false0boolean lang(string): returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string9number number(object?): converts its argument to a number1number sum(node-set): returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number2number floor(number): returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer3number ceiling(number): returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer4number round(number): 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.5node-set key(string, object): does for keys what the id function does for IDs The first argument specifies the name of the key. When the second argument is of type node-set, then the result is the union of the result of applying the key function to the string value 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 string6 string format-number(number, string, string?): converts its first argument to a string using the format pattern string specified by the second argument and the decimal-format named by the third argument, or the default decimal-format, if there is no third argumentT789:;<=>?@ABCDE !"#FG$%&'H(I)J*+K,LM-./01234N5OPQRS6TUVWXYZ[\]^ Q987:;<=>?@ABCDE !"#FG$%&'H(I)J*+K,LM-./01234N5OPQRS6TUVWXYZ[\]^*Copyright (C) 2008 - infinity: Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone&Convert an navigable tree in a xmltreeGFormat a XPath-value in string representation. Text output is done by _E for node-sets (trees), all other values are represented as strings.&Convert a a XPath-value into XmlTrees.QFormat a parsed XPath-expression in tree representation. Text output is done by _ `abcde `abcde #Copyright (C) 2006-2011 Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone"GSelect parts of a document by a string representing a XPath expression.}The main filter for selecting parts of a document via XPath. The string argument must be a XPath expression with an absolute location path, the argument tree must be a complete document tree. Result is a possibly empty list of XmlTrees forming the set of selected XPath values. XPath values other than XmlTrees (numbers, attributes, tagnames, ...) are converted to text nodes.@Select parts of a document by an already parsed XPath expressionASelect parts of a document by a namespace aware XPath expression. Works like x but the prefix:localpart names in the XPath expression are interpreted with respect to the given namespace environmentISelect parts of an XML tree by a string representing an XPath expression.The main filter for selecting parts of an arbitrary XML tree via XPath. The string argument must be a XPath expression with an absolute location path, There are no restrictions on the arument tree.<No canonicalization is performed before evaluating the queryResult is a possibly empty list of XmlTrees forming the set of selected XPath values. XPath values other than XmlTrees (numbers, attributes, tagnames, ...) are convertet to text nodes.3Select parts of an XML tree by an XPath expression.Same as * but with namespace aware XPath expression&compute the node set of an XPath queryGcompute the node set of an XPath query for an already parsed XPath expr5compute the node set of a namespace aware XPath queryf4parse xpath, evaluate xpath expr and prepare resultsg4parse xpath, evaluate xpath expr and prepare resultspparse 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 4H-parameter contains the set of global variables for the evaluator, the GE-parameter the root of the tree in which the expression is evaluated.h)filter for evaluating a filter-expressioniGreturns the union of its arguments, the arguments have to be node-sets.jEquality or relational test for node-sets, numbers, boolean values or strings, each computation of two operands is done by relEqEv'kEquality or relational test for two node-sets. The comparison will be true if and only if there is a node in the first node-set 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 truelComparison between a node-set and different type. The node-set is converted in a boolean value if the second argument is of type boolean. If the argument is of type number, the node-set is converted in a number, otherwise it is converted in a string value.m$No node-set is involved and the operator is equality or not-equality. The arguments are converted in a common type. If one argument is a boolean value 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.n8Filter for accessing the root element of a document treeo.Filter for accessing all nodes of a XPath-axis 1.parameter as : axis specifierp\Axis-Function-Table. Each XPath axis-specifier is mapped to the corresponding axis-functionq~evaluates a location path, evaluation of an absolute path starts at the document root, the relative path at the context noder=evaluate a single XPath step namespace-axis is not supportedsKfilter for selecting a special type of nodes from the current fragment treethe filter works with namespace activated and without namespaces. If namespaces occur in XPath names, the uris are used for matching, else the name prefixBBugfix : "*" (or any other name-test) must not match the root nodetjthe filter selects the NTree part of a navigable tree and tests whether the node is of the necessary type_1.parameter fct : filter function from the XmlTreeFilter module which tests the type of a nodeu)tests whether a node is of a special typev<evaluates a boolean expression, the evaluation is non-strictwreturns the value of a variablex.evaluates a function, computation is done by   which is defined in XPathFct.y"evaluates an arithmetic operation. (parameter f : arithmetic function from XPathArithmeticz>Convert list of ID attributes from DTD into a space separated @{CExtracts all ID-attributes from the document type definition (DTD).>|}f~ghijklmnopqrstuvwxyz{ >|}f~ghijklmnopqrstuvwxyz{ 'Copyright (C) 2006-infinity Uwe SchmidtMITUwe Schmidt (uwe@fh-wedel.de) experimentalportableNone JSelect parts of a whole XML document with root node by a XPath expression.<The main filter for selecting parts of a document via XPath.The string argument must be a XPath expression with an absolute location path, the argument tree must be a complete document tree.GBefore evaluating the xpath query, the document is canonicalized with Result is a possibly empty list of XmlTrees forming the set of selected XPath values. XPath values other than XmlTrees (numbers, attributes, tagnames, ...) are convertet to text nodes.Same as 3 but with namespace environment for the XPath names<Select parts of an arbitrary XML tree by a XPath expression.The main filter for selecting parts of an arbitrary XML tree via XPath. The string argument must be a XPath expression with an absolute location path, There are no restrictions on the argument tree.<No canonicalization is performed before evaluating the queryResult is a possibly empty list of XmlTrees forming the set of selected XPath values. XPath values other than XmlTrees (numbers, attributes, tagnames, ...) are convertet to text nodes.Same as 3 but with namespace environment for the XPath namesGSelect a set of nodes via an XPath expression from an arbitray XML treeThe result is a set of "pointers" to nodes. This set can be used to access or modify the values of the subnodes in subsequent calls to  or .This 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 3 but with namespace environment for the XPath namesTcompute a node set from a tree, containing all nodes selected by the predicate arrowBcomputation of the set of element nodes with name "a" is done with getElemNodeSet (hasName "a")ncompute 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 setthe following law holds: -getFromNodeSet $< getElemNodeSet f == multi f4process all subtrees selected by an XPath expressionthe following law holds: RprocessXPathTrees p xpathExpr == processFromNodeSet p $< getXPathNodeSet xpathExprSame as 3 but with namespace environment for the XPath namesTprocess all subtrees specified by a previously computed node set in bottom up mannerthe following law should hold: HprocessFromNodeSet g $< getElemNodeSet f == processBottomUp (g `when` f)3when attributes are contained in the node set (see E), these are processed after the children and before the node itselfthe advantage of processFromNodeSet is the separation of the selection of set of nodes to be processed (e.g. modified) from the real proccessing. The selection sometimes can be done once, the processing possibly many times.  None! !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst u v w x y z { | } ~                                           hxt-xpath-9.1.2.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.ArrowsXPathFctevalFctText.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 $fOrdNodeSet $fEqNodeSet $fOrdXPNumber $fEqXPNumber$fShowXPNumber xPathUnary xPathMultixPathModxPathDivxPathAddxPValue2XmlNodeSetemptyXmlNodeSet parseNumber parseXPathXFct getKeyTab getVarTab getConvFctisNotInNodeListtoXValue stringValuexstringxbooleanxnumber toXPathTreeformatXPathTreexPValue2StringxPValue2XmlTreesexpr2XPathTree nt2XPathTreepred2XPathTreegetXPath getXPath'getXPathWithNsEnvgetXPathSubTreesgetXPathSubTrees'getXPathSubTreesWithNsEnvgetXPathNodeSet'getXPathNodeSet''getXPathNodeSetWithNsEnv'addRoot'parseXPathExprparseXPathExprWithNsEnvevalExprgetXPathTreesInDocgetXPathTreesInDocWithNsEnv getXPathTreesgetXPathTreesWithNsEnvgetXPathNodeSetgetElemNodeSetgetElemAndAttrNodeSetgetFromNodeSetprocessXPathTreesprocessXPathTreesWithNsEnvprocessFromNodeSet hxt-9.3.1.15Data.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 IdPathStep CheckArgCount FctTableElemFctTablefctTablexlast xpositionxcountxidgetIds xlocalName xnamespaceUrixname getFirstPosxconcat xstartsWith xcontainsxsubstringBeforexsubstringAfter xsubstring xstringLengthxnormalizeSpace xtranslatexnotxtruexfalsexlangxsumxfloorxceilingxroundxkey xformatNumberIdAttrIdPosIdRoot int2XPNumberzero zeroOrOneonetwotwoOrM twoOrThreethreenodeIDnodeID'isInIdfilterNS getFirstPos' strStartsWithxsubstringBefore'xsubstringAfter' xsubstring'normStr xtranslate'replacexround'isInKey isKeyNameisKeyVal isOfKeyName isOfKeyValue xdocument xdocument' xgenerateId xgenerateId' str2XmlId xpNamePart xpLocalPartOf xpNamespaceOfxpNameOfgetValuexpTextOfText.XML.HXT.DOM.FormatXmlTree formatXmlTree XPathTreextextxerrlocpath2XPathTreestep2XPathTreetypeTest2StringgetXPathValuesgetXPathValues' filterEval unionEval relEqEval relEqTwoNodes relEqOneNodeeqEvgetRoot getAxisNodesaxisFctL locPathEvalevalStep filterNodes'typeTestboolEval getVariablefctEvalnumEvalidAttributesToXPathValuegetIdAttributes NodeListResNodeListxPathErr evalExprL evalSpezExprrelEqEv'getOpFctnodeListResToXPathValuenullNLplusNLsumNLmapNLmapNL' evalStepsevalAttrevalAttrNodeTest evalStep' evalPredLevalPred evalPred' testPredicate nodeTest' wildcardTest isIdAttrType valueOfDTDhasDTDAttrValueText.XML.HXT.Arrow.EditcanonicalizeForXPathgetXPathNodeSetWithNsEnv getNodeSetgetFromNodeSet'processFromNodeSet'