Details
CHECK_TYPE()
#define CHECK_TYPE(typeval) |
xmlXPathObjectPtr ()
typedef xmlXPathObjectPtr (); |
xmlXPathRegisterVariableLookup ()
void xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
xmlXPathVariableLookupFunc f,
void *varCtxt); |
register an external mechanism to do variable lookup
xmlXPathDebugDumpObject ()
xmlXPathRegisterNs ()
Register a new namespace. If ns_uri is NULL it unregisters
the namespace
xmlXPathNsLookup ()
Search in the namespace declaration array of the context for the given
namespace name associated to the given prefix
xmlXPathRegisteredNsCleanup ()
xmlXPathRegisterFunc ()
Register a new function. If f is NULL it unregisters the function
xmlXPathRegisterFuncNS ()
Register a new function. If f is NULL it unregisters the function
xmlXPathRegisterVariable ()
Register a new variable value. If value is NULL it unregisters
the variable
xmlXPathRegisterVariableNS ()
Register a new variable value. If value is NULL it unregisters
the variable
xmlXPathFunctionLookup ()
Search in the Function array of the context for the given
function.
xmlXPathFunctionLookupNS ()
Search in the Function array of the context for the given
function.
xmlXPathRegisteredFuncsCleanup ()
Cleanup the XPath context data associated to registered functions
xmlXPathVariableLookup ()
Search in the Variable array of the context for the given
variable value.
xmlXPathVariableLookupNS ()
Search in the Variable array of the context for the given
variable value.
xmlXPathRegisteredVariablesCleanup ()
Cleanup the XPath context data associated to registered variables
xmlXPathNewParserContext ()
Create a new xmlXPathParserContext
xmlXPathFreeParserContext ()
Free up an xmlXPathParserContext
xmlXPathNewString ()
Create a new xmlXPathObjectPtr of type string and of value val
xmlXPathNewCString ()
Create a new xmlXPathObjectPtr of type string and of value val
xmlXPathNewFloat ()
Create a new xmlXPathObjectPtr of type double and of value val
xmlXPathNewBoolean ()
Create a new xmlXPathObjectPtr of type boolean and of value val
xmlXPathNewNodeSet ()
Create a new xmlXPathObjectPtr of type NodeSet and initialize
it with the single Node val
xmlXPathNewValueTree ()
Create a new xmlXPathObjectPtr of type Value Tree (XSLT) and initialize
it with the tree root val
xmlXPathNodeSetAdd ()
add a new xmlNodePtr ot an existing NodeSet
xmlXPathIdFunction ()
Implement the id() XPath function
node-set id(object)
The id function selects elements by their unique ID
(see [5.2.1 Unique IDs]). When the argument to id is of type node-set,
then the result is the union of the result of applying id to the
string value of each of the nodes in the argument node-set. When the
argument to id is of any other type, the argument is converted to a
string as if by a call to the string function; the string is split
into a whitespace-separated list of tokens (whitespace is any sequence
of characters matching the production S); the result is a node-set
containing the elements in the same document as the context node that
have a unique ID equal to any of the tokens in the list.
xmlXPathRoot ()
Initialize the context to the root of the document
xmlXPathEvalExpr ()
[14] Expr ::= OrExpr
[21] OrExpr ::= AndExpr
| OrExpr 'or' AndExpr
Parse and evaluate an expression, then push the result on the stack
xmlXPathParseName ()
parse an XML name
[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
CombiningChar | Extender
[5] Name ::= (Letter | '_' | ':') (NameChar)*
xmlXPathParseNCName ()
parse an XML namespace non qualified name.
[NS 3] NCName ::= (Letter | '_') (NCNameChar)*
[NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
CombiningChar | Extender
xmlXPathStringEvalNumber ()
double xmlXPathStringEvalNumber (const xmlChar *str); |
[30] Number ::= Digits ('.' Digits?)?
| '.' Digits
[31] Digits ::= [0-9]+
Parse and evaluate a Number in the string
In complement of the Number expression, this function also handles
negative values : '-' Number.
xmlXPathEvaluatePredicateResult ()
Evaluate a predicate result for the current node.
A PredicateExpr is evaluated by evaluating the Expr and converting
the result to a boolean. If the result is a number, the result will
be converted to true if the number is equal to the position of the
context node in the context node list (as returned by the position
function) and will be converted to false otherwise; if the result
is not a number, then the result will be converted as if by a call
to the boolean function.
Return 1 if predicate is true, 0 otherwise
xmlXPathInit ()
void xmlXPathInit (void); |
Initialize the XPath environment
xmlXPathStringFunction ()
Implement the string() XPath function
string string(object?)
he string function converts an object to a string as follows:
- A node-set is converted to a string by returning the value of
the node in the node-set that is first in document order.
If the node-set is empty, an empty string is returned.
- A number is converted to a string as follows
+ NaN is converted to the string NaN
+ positive zero is converted to the string 0
+ negative zero is converted to the string 0
+ positive infinity is converted to the string Infinity
+ negative infinity is converted to the string -Infinity
+ if the number is an integer, the number is represented in
decimal form as a Number with no decimal point and no leading
zeros, preceded by a minus sign (-) if the number is negative
+ otherwise, the number is represented in decimal form as a
Number including a decimal point with at least one digit
before the decimal point and at least one digit after the
decimal point, preceded by a minus sign (-) if the number
is negative; there must be no leading zeros before the decimal
point apart possibly from the one required digit immediatelyi
before the decimal point; beyond the one required digit
after the decimal point there must be as many, but only as
many, more digits as are needed to uniquely distinguish the
number from all other IEEE 754 numeric values.
- The boolean false value is converted to the string false.
The boolean true value is converted to the string true.
If the argument is omitted, it defaults to a node-set with the
context node as its only member.
xmlXPathRegisterAllFunctions ()
Registers all default XPath functions in this context
xmlXPathNodeSetCreate ()
Create a new xmlNodeSetPtr of type double and of value val
xmlXPathNodeSetMerge ()
Merges two nodesets, all nodes from val2 are added to val1
if val1 is NULL, a new set is created and copied from val2
xmlXPathNodeSetDel ()
Removes an xmlNodePtr from an existing NodeSet
xmlXPathNodeSetRemove ()
Removes an entry from an existing NodeSet list.
xmlXPathFreeNodeSet ()
Free the NodeSet compound (not the actual nodes !).
xmlXPathNewNodeSetList ()
Create a new xmlXPathObjectPtr of type NodeSet and initialize
it with the Nodeset val
xmlXPathWrapNodeSet ()
Wrap the Nodeset val in a new xmlXPathObjectPtr
xmlXPathFreeNodeSetList ()
Free up the xmlXPathObjectPtr obj but don't deallocate the objects in
the list contrary to xmlXPathFreeObject().
xmlXPathFreeObject ()
Free up an xmlXPathObjectPtr object.
xmlXPathNewContext ()
Create a new xmlXPathContext
xmlXPathFreeContext ()
Free up an xmlXPathContext
xmlXPathEqualValues ()
Implement the equal operation on XPath objects content: arg1 == arg2
xmlXPathCompareValues ()
Implement the compare operation on XPath objects:
arg1 < arg2 (1, 1, ...
arg1 <= arg2 (1, 0, ...
arg1 > arg2 (0, 1, ...
arg1 >= arg2 (0, 0, ...
When neither object to be compared is a node-set and the operator is
<=, <, >=, >, then the objects are compared by converted both objects
to numbers and comparing the numbers according to IEEE 754. The <
comparison will be true if and only if the first number is less than the
second number. The <= comparison will be true if and only if the first
number is less than or equal to the second number. The > comparison
will be true if and only if the first number is greater than the second
number. The >= comparison will be true if and only if the first number
is greater than or equal to the second number.
xmlXPathValueFlipSign ()
Implement the unary - operation on an XPath object
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathAddValues ()
Implement the add operation on XPath objects:
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathSubValues ()
Implement the substraction operation on XPath objects:
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathMultValues ()
Implement the multiply operation on XPath objects:
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathDivValues ()
Implement the div operation on XPath objects arg1 / arg2:
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathModValues ()
Implement the mod operation on XPath objects: arg1 / arg2
The numeric operators convert their operands to numbers as if
by calling the number function.
xmlXPathLastFunction ()
Implement the last() XPath function
number last()
The last function returns the number of nodes in the context node list.
xmlXPathPositionFunction ()
Implement the position() XPath function
number position()
The position function returns the position of the context node in the
context node list. The first position is 1, and so the last positionr
will be equal to last().
xmlXPathCountFunction ()
Implement the count() XPath function
number count(node-set)
xmlXPathLocalNameFunction ()
Implement the local-name() XPath function
string local-name(node-set?)
The local-name function returns a string containing the local part
of the name of the node in the argument node-set that is first in
document order. If the node-set is empty or the first node has no
name, an empty string is returned. If the argument is omitted it
defaults to the context node.
xmlXPathNamespaceURIFunction ()
Implement the namespace-uri() XPath function
string namespace-uri(node-set?)
The namespace-uri function returns a string containing the
namespace URI of the expanded name of the node in the argument
node-set that is first in document order. If the node-set is empty,
the first node has no name, or the expanded name has no namespace
URI, an empty string is returned. If the argument is omitted it
defaults to the context node.
xmlXPathStringLengthFunction ()
Implement the string-length() XPath function
number string-length(string?)
The string-length returns the number of characters in the string
(see [3.6 Strings]). If the argument is omitted, it defaults to
the context node converted to a string, in other words the value
of the context node.
xmlXPathConcatFunction ()
Implement the concat() XPath function
string concat(string, string, string*)
The concat function returns the concatenation of its arguments.
xmlXPathContainsFunction ()
Implement the contains() XPath function
boolean contains(string, string)
The contains function returns true if the first argument string
contains the second argument string, and otherwise returns false.
xmlXPathStartsWithFunction ()
Implement the starts-with() XPath function
boolean starts-with(string, string)
The starts-with function returns true if the first argument string
starts with the second argument string, and otherwise returns false.
xmlXPathSubstringFunction ()
Implement the substring() XPath function
string substring(string, number, number?)
The substring function returns the substring of the first argument
starting at the position specified in the second argument with
length specified in the third argument. For example,
substring("12345",2,3) returns "234". 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. For
example, substring("12345",2) returns "2345". More precisely, each
character in the string (see [3.6 Strings]) is considered to have a
numeric position: the position of the first character is 1, the position
of the second character is 2 and so on. The returned substring contains
those characters for which the position of the character is greater than
or equal to the second argument and, if the third argument is specified,
less than the sum of the second and third arguments; the comparisons
and addition used for the above follow the standard IEEE 754 rules. Thus:
- substring("12345", 1.5, 2.6) returns "234"
- substring("12345", 0, 3) returns "12"
- substring("12345", 0 div 0, 3) returns ""
- substring("12345", 1, 0 div 0) returns ""
- substring("12345", -42, 1 div 0) returns "12345"
- substring("12345", -1 div 0, 1 div 0) returns ""
xmlXPathSubstringBeforeFunction ()
Implement the substring-before() XPath function
string substring-before(string, string)
The substring-before function 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. For example, substring-before("1999/04/01","/") returns 1999.
xmlXPathSubstringAfterFunction ()
Implement the substring-after() XPath function
string substring-after(string, string)
The substring-after function 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 stringi
if the first argument string does not contain the second argument
string. For example, substring-after("1999/04/01","/") returns 04/01,
and substring-after("1999/04/01","19") returns 99/04/01.
xmlXPathNormalizeFunction ()
Implement the normalize-space() XPath function
string normalize-space(string?)
The normalize-space function returns the argument string with white
space normalized by stripping leading and trailing whitespace
and replacing sequences of whitespace characters by a single
space. Whitespace characters are the same allowed by the S production
in XML. If the argument is omitted, it defaults to the context
node converted to a string, in other words the value of the context node.
xmlXPathTranslateFunction ()
Implement the translate() XPath function
string translate(string, string, string)
The translate function 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
string. For example, translate("bar","abc","ABC") returns the string
BAr. If there is a character in the second argument string with no
character at a corresponding position in the third argument string
(because the second argument string is longer than the third argument
string), then occurrences of that character in the first argument
string are removed. For example, translate("--aaa--","abc-","ABC")
xmlXPathNotFunction ()
Implement the not() XPath function
boolean not(boolean)
The not function returns true if its argument is false,
and false otherwise.
xmlXPathTrueFunction ()
Implement the true() XPath function
boolean true()
xmlXPathFalseFunction ()
Implement the false() XPath function
boolean false()
xmlXPathLangFunction ()
Implement the lang() XPath function
boolean lang(string)
The lang function 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 string. The language of the context node is determined
by the value of the xml:lang attribute on the context node, or, if
the context node has no xml:lang attribute, by the value of the
xml:lang attribute on the nearest ancestor of the context node that
has an xml:lang attribute. If there is no such attribute, then lang
xmlXPathNumberFunction ()
Implement the number() XPath function
number number(object?)
xmlXPathSumFunction ()
Implement the sum() XPath function
number sum(node-set)
The sum function returns the sum of the values of the nodes in
the argument node-set.
xmlXPathFloorFunction ()
Implement the floor() XPath function
number floor(number)
The floor function returns the largest (closest to positive infinity)
number that is not greater than the argument and that is an integer.
xmlXPathCeilingFunction ()
Implement the ceiling() XPath function
number ceiling(number)
The ceiling function returns the smallest (closest to negative infinity)
number that is not less than the argument and that is an integer.
xmlXPathRoundFunction ()
Implement the round() XPath function
number round(number)
The round function 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 even is returned.
xmlXPathBooleanFunction ()
Implement the boolean() XPath function
boolean boolean(object)
he boolean function converts its argument to a boolean as follows:
- a number is true if and only if it is neither positive or
negative zero nor NaN
- a node-set is true if and only if it is non-empty
- a string is true if and only if its length is non-zero