1 <?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?>
6 &copy; 2001-2003 Ginger Alliance<BR/>
7 <I>revision 03-01-31</I><BR/>
10 <ENTRY id=".Introduction">
11 <TYPE value="General"/>
13 The <B>Sablotron XPath processor</B> (SXP) enables the user to evaluate
14 an XPath query on a DOM document accessed via callback functions
15 provided by the user. The interface to SXP is written in C. SXP
16 is a part of Sablotron, an XSLT processor by Ginger Alliance.
18 <SEEALSO value=".Building"/>
19 <SEEALSO value=".Usage"/>
20 <SEEALSO value=".Errors"/>
23 <ENTRY id=".Building">
24 <TYPE value="General"/>
26 All declarations described in this document, if
27 not specified otherwise, are to be found in the Sablotron header
28 file <C>sxpath.h</C>. When building an executable using the SXP,
29 include <C>sxpath.h</C> and link the Sablotron library (<C>-lsablot</C>).
34 <TYPE value="General"/>
36 On error, most SXP interface functions output a Sablotron error
37 message and return an error code which can be passed to functions
38 like <C>SablotGetErrorMsg</C> (declared in <C>sablot.h</C>).
40 <P/>In the callbacks, in contrast, error handling has been kept to
41 a minimum. Typically, in case of an error, a callback just returns
42 a special value such as NULL.
47 <TYPE value="General"/>
49 To work with SXP, the user needs to instantiate a
50 <C>SablotSituation</C>, register a DOM handler (a set of DOM-like
51 callback functions) using <C>SXP_registerDOMHandler</C>, and create a
52 query context using <C>SXP_createQueryContext</C>.
57 DOMHandler my_domhandler=
60 /* ... more callbacks follow ... */
62 /* let us say the root is 123 */
63 SXP_Node root = (SXP_Node) 123;
66 SablotCreateSituation(&S);
67 SXP_registerDOMHandler(S, &my_domhandler);
68 SXP_createQueryContext(S, &Q);
69 /* perform the query with the root as the context node */
70 SXP_query(Q, "//*", root, 1, 1);
71 SXP_getResultString(Q, &result);
73 SXP_destroyQueryContext(Q);
74 SablotDestroySituation(S);
77 For clarity, error checking has been omitted from the above
88 <ENTRY id="SablotSituation">
91 The type representing a general "context" for Sablotron. Mainly
92 used for error reporting. An object of this type can be created
93 using <C>SablotCreateSituation</C>.
96 <C>SablotSituation</C> is declared in <C>sablot.h</C>.
100 <ENTRY id="SXP_char">
101 <TYPE value="Types"/>
103 SXP character type. Currently just UTF-8 encoded <C>char</C>.
107 <ENTRY id="SXP_Node">
108 <TYPE value="Types"/>
114 <ENTRY id="SXP_Document">
115 <TYPE value="Types"/>
117 A document type. <C>SXP_Document</C> can be used in place of any
118 <C>SXP_Node</C>, in which case it represents the document root
119 node. A synonym for <C>SXP_Node</C> is <C>NodeHandle</C>.
123 <ENTRY id="SXP_NodeList">
124 <TYPE value="Types"/>
126 A node list type. Node lists are returned by
127 <C>SXP_getResultNodeset</C> and are manipulated using
128 <C>SXP_getNodeListLength</C> and <C>SXP_getNodeListItem</C>.
132 <ENTRY id="QueryContext">
133 <TYPE value="Types"/>
135 A type representing the context of a query, which can hold (1)
136 namespace declarations for the next call to <C>SXP_query</C>, (2)
137 variable bindings for the same, (3) the result of a
138 <C>SXP_query</C>. An object of this type is created using
139 <C>SXP_createQueryContext</C> and freed using
140 <C>SXP_destroyQueryContext</C>. The evaluation result may be
141 retrieved using functions like <C>SXP_getResultString</C>.
143 <SEEALSO value="SXP_addVariableString"/>
144 <SEEALSO value="SXP_addVariableBinding"/>
145 <SEEALSO value="SXP_addNamespaceDeclaration"/>
154 <ENTRY id="SXP_ExpressionType">
155 <TYPE value="Enums"/>
157 The type for expressions in the SXP. Possible values include
158 <C>SXP_NONE</C> (unknown type), <C>SXP_NUMBER</C>,
159 <C>SXP_STRING</C>, <C>SXP_BOOLEAN</C> and <C>SXP_NODESET</C>.
161 <SEEALSO value="SXP_getResultType"/>
164 <ENTRY id="SXP_NodeType">
165 <TYPE value="Enums"/>
167 The type for nodes in the SXP. Possible values include:
169 <li> ELEMENT_NODE,
170 <li> ATTRIBUTE_NODE,
172 <li> PROCESSING_INSTRUCTION_NODE,
173 <li> COMMENT_NODE,
174 <li> DOCUMENT_NODE,
175 <li> NAMESPACE_NODE.
186 <ENTRY id="SablotCreateSituation">
187 <TYPE value="Functions"/>
189 SablotCreateSituation(sPtr)
190 <PARAM name="sPtr" type="SablotSituation *">
191 Pointer to where the result is to be stored.
193 <PARAM name="(RET)" type="int">
198 Creates a <C>SablotSituation</C> which is passed to many Sablotron
199 functions and can be later destroyed by a call to <C>SablotDestroySituation</C>.
202 <C>SablotCreateSituation</C> is declared in <C>sablot.h</C>.
206 <ENTRY id="SablotDestroySituation">
207 <TYPE value="Functions"/>
209 SablotDestroySituation(S)
210 <PARAM name="S" type="SablotSituation">
211 The situation to be freed.
213 <PARAM name="(RET)" type="int">
218 Frees a <C>SablotSituation</C>.
221 <C>SablotDestroySituation</C> is declared in <C>sablot.h</C>.
225 <ENTRY id="SXP_registerDOMHandler">
226 <TYPE value="Functions"/>
228 SXP_registerDOMHandler(S, domh);
229 <PARAM name="S" type="SablotSituation">
230 The current situation.
232 <PARAM name="domh" type="DOMHandler *">
233 Pointer to the new DOM handler.
237 Registers a new <C>DOMHandler</C> with the given
238 <C>SablotSituation</C>. There may only be one DOM handler per
239 situation. The DOM handler will receive all DOM requests made
240 during evaluation with the situation S. To unregister the handler,
241 use <C>SXP_unregisterDOMHandler</C>.
245 <ENTRY id="SXP_unregisterDOMHandler">
246 <TYPE value="Functions"/>
248 SXP_unregisterDOMHandler(S)
249 <PARAM name="S" type="SablotSituation">
250 The current situation.
254 Unregisters the <C>DOMHandler</C> registered with the given
255 <C>SablotSituation</C>. All DOM requests will be processed in the
260 <ENTRY id="SXP_createQueryContext">
261 <TYPE value="Functions"/>
263 SXP_createQueryContext(S, Qptr)
264 <PARAM name="S" type="SablotSituation">
265 The current situation.
267 <PARAM name="Qptr" type="QueryContext *">
268 Pointer to where to store the query context.
270 <PARAM name="(RET)" type="int">
275 Creates a <C>QueryContext</C>.
279 <ENTRY id="SXP_destroyQueryContext">
280 <TYPE value="Functions"/>
282 SXP_destroyQueryContext(Q)
283 <PARAM name="Q" type="QueryContext">
284 The query context to be deleted.
286 <PARAM name="(RET)" type="int">
291 Destroys a <C>QueryContext</C>, freeing all the memory it used,
292 including any <C>SXP_query</C> result and the pending variable
293 bindings and namespace declaration lists.
297 <ENTRY id="SXP_addVariableBinding">
298 <TYPE value="Functions"/>
300 SXP_addVariableBinding(Q, name, source)
301 <PARAM name="Q" type="QueryContext">
302 The current query context.
304 <PARAM name="name" type="const SXP_char*">
305 The name of the variable.
307 <PARAM name="source" type="QueryContext">
308 Another <C>QueryContext</C> which has been evaluated
309 already. The variable will be bound to its result expression.
311 <PARAM name="(RET)" type="int">
316 Binds a variable to the result expression of another
317 <C>QueryContext</C>. The binding will only be in effect for the
318 next <C>SXP_query</C>. <C>SXP_addVariableBinding</C> provides the
319 only way to bind the variable to a node set.
321 <SEEALSO value="SXP_addVariableNumber"/>
322 <SEEALSO value="SXP_addVariableString"/>
323 <SEEALSO value="SXP_addVariableBoolean"/>
326 <ENTRY id="SXP_addVariableNumber">
327 <TYPE value="Functions"/>
329 SXP_addVariableNumber(Q, name, value)
330 <PARAM name="Q" type="QueryContext">
331 The current query context.
333 <PARAM name="name" type="const SXP_char*">
334 The name of the variable.
336 <PARAM name="value" type="double">
337 The number to bind the variable to.
339 <PARAM name="(RET)" type="int">
344 Binds a variable to a number. The binding will only be in effect for the
345 next <C>SXP_query</C>.
347 <SEEALSO value="SXP_addVariableBinding"/>
348 <SEEALSO value="SXP_addVariableString"/>
349 <SEEALSO value="SXP_addVariableBoolean"/>
352 <ENTRY id="SXP_addVariableString">
353 <TYPE value="Functions"/>
355 SXP_addVariableString(Q, name, value)
356 <PARAM name="Q" type="QueryContext">
357 The current query context.
359 <PARAM name="name" type="const SXP_char*">
360 The name of the variable.
362 <PARAM name="value" type="const SXP_char*">
363 The string to bind the variable to.
365 <PARAM name="(RET)" type="int">
370 Binds a variable to a string. The binding will only be in effect for the
371 next <C>SXP_query</C>.
373 <SEEALSO value="SXP_addVariableBinding"/>
374 <SEEALSO value="SXP_addVariableNumber"/>
375 <SEEALSO value="SXP_addVariableBoolean"/>
378 <ENTRY id="SXP_addVariableBoolean">
379 <TYPE value="Functions"/>
381 SXP_addVariableBoolean(Q, name, value)
382 <PARAM name="Q" type="QueryContext">
383 The current query context.
385 <PARAM name="name" type="const SXP_char*">
386 The name of the variable.
388 <PARAM name="value" type="int">
389 The boolean value to bind the variable to.
391 <PARAM name="(RET)" type="int">
396 Binds a variable to a boolean. The binding will only be in effect for the
397 next <C>SXP_query</C>.
399 <SEEALSO value="SXP_addVariableBinding"/>
400 <SEEALSO value="SXP_addVariableString"/>
401 <SEEALSO value="SXP_addVariableNumber"/>
404 <ENTRY id="SXP_addNamespaceDeclaration">
405 <TYPE value="Functions"/>
407 SXP_addNamespaceDeclaration(Q, prefix, uri)
408 <PARAM name="Q" type="QueryContext">
409 The current query context.
411 <PARAM name="prefix" type="const SXP_char*">
412 The namespace prefix.
414 <PARAM name="uri" type="const SXP_char*">
417 <PARAM name="(RET)" type="int">
422 Declares a new namespace with the given prefix and URI. The
423 declaration will only be in effect for the next <C>SXP_query</C>.
425 <SEEALSO value="SXP_addVariableBinding"/>
428 <ENTRY id="SXP_query">
429 <TYPE value="Functions"/>
431 SXP_query(Q, query, node, position, size)
432 <PARAM name="Q" type="QueryContext">
433 The current query context.
435 <PARAM name="query" type="const SXP_char*">
436 The text of the query.
438 <PARAM name="node" type="SXP_Node">
439 The current node for the query.
441 <PARAM name="position" type="int">
442 The position of the current node in the evaluation context. As SXP
443 is a C interface, the position is zero-based (unlike one-based
444 XPath nodesets). Thus, you must set this parameter to 0 if you want
445 the "position()" query to return 1.
447 <PARAM name="size" type="int">
448 The size of the evaluation context.
450 <PARAM name="(RET)" type="int">
455 Evaluates a query (given as text) based on the current node, the
456 context position (zero-based) and the context size. Any namespaces
457 declared using <C>SXP_addNamespaceDeclaration</C> are used for the
458 evaluation, as are the variable bindings made using functions like
459 <C>SXP_addVariableString</C>. Upon completion of the query, the
460 pending namespace declarations and variable bindings are <B>cleared</B>.
463 SXP_query(Q, "node[1]/@att", root, 0, 1);
465 <SEEALSO value="SXP_getResultString"/>
466 <SEEALSO value="SXP_getResultType"/>
469 <ENTRY id="SXP_getResultType">
470 <TYPE value="Functions"/>
472 SXP_getResultType(Q, typePtr)
473 <PARAM name="Q" type="QueryContext">
474 The current query context.
476 <PARAM name="typePtr" type="SXP_ExpressionType*">
477 The pointer to store the result type at.
479 <PARAM name="(RET)" type="int">
484 Retrieves the type of a result expression (<C>SXP_ExpressionType</C>) held in
485 <C>QueryContext</C> after <C>SXP_query</C> has been called.
487 <SEEALSO value="SXP_getResultNumber"/>
488 <SEEALSO value="SXP_getResultBool"/>
489 <SEEALSO value="SXP_getResultString"/>
490 <SEEALSO value="SXP_getResultNodeset"/>
493 <ENTRY id="SXP_getResultNumber">
494 <TYPE value="Functions"/>
496 SXP_getResultNumber(Q, resultPtr)
497 <PARAM name="Q" type="QueryContext">
498 The current query context.
500 <PARAM name="resultPtr" type="double*">
501 The pointer to store the result at.
503 <PARAM name="(RET)" type="int">
508 Retrieves the result of a <C>SXP_query</C> as a double, performing
509 a type conversion if necessary.
511 <SEEALSO value="SXP_getResultBool"/>
512 <SEEALSO value="SXP_getResultString"/>
513 <SEEALSO value="SXP_getResultNodeset"/>
514 <SEEALSO value="SXP_getResultType"/>
517 <ENTRY id="SXP_getResultBool">
518 <TYPE value="Functions"/>
520 SXP_getResultBool(Q, resultPtr)
521 <PARAM name="Q" type="QueryContext">
522 The current query context.
524 <PARAM name="resultPtr" type="int*">
525 The pointer to store the result at.
527 <PARAM name="(RET)" type="int">
532 Retrieves the result of a <C>SXP_query</C> as a boolean, performing
533 a type conversion if necessary.
535 <SEEALSO value="SXP_getResultNumber"/>
536 <SEEALSO value="SXP_getResultString"/>
537 <SEEALSO value="SXP_getResultNodeset"/>
538 <SEEALSO value="SXP_getResultType"/>
541 <ENTRY id="SXP_getResultString">
542 <TYPE value="Functions"/>
544 SXP_getResultString(Q, resultPtr)
545 <PARAM name="Q" type="QueryContext">
546 The current query context.
548 <PARAM name="resultPtr" type="const char**">
549 The pointer to store the result at.
551 <PARAM name="(RET)" type="int">
556 Retrieves the result of a <C>SXP_query</C> as a string, performing
557 a type conversion if necessary.
559 <SEEALSO value="SXP_getResultNumber"/>
560 <SEEALSO value="SXP_getResultBool"/>
561 <SEEALSO value="SXP_getResultNodeset"/>
562 <SEEALSO value="SXP_getResultType"/>
565 <ENTRY id="SXP_getResultNodeset">
566 <TYPE value="Functions"/>
568 SXP_getResultNodeset(Q, resultPtr)
569 <PARAM name="Q" type="QueryContext">
570 The current query context.
572 <PARAM name="resultPtr" type="SXP_NodeList*">
573 The pointer to store the result at.
575 <PARAM name="(RET)" type="int">
580 Retrieves the result of a <C>SXP_query</C> as a nodeset. This can
581 be subsequently manipulated using <C>SXP_getNodeListItem</C> and
582 <C>SXP_getNodeListLength</C>. If the result is not of type
583 nodeset, then XPath does not allow its conversion to a nodeset,
584 and <C>SXP_ getResultNodeset</C> returns NULL in *resultPtr.
586 <SEEALSO value="SXP_getResultNumber"/>
587 <SEEALSO value="SXP_getResultBool"/>
588 <SEEALSO value="SXP_getResultString"/>
589 <SEEALSO value="SXP_getResultType"/>
592 <ENTRY id="SXP_getNodeListLength">
593 <TYPE value="Functions"/>
595 SXP_getNodeListLength(list)
596 <PARAM name="list" type="SXP_NodeList">
599 <PARAM name="(RET)" type="int">
604 Returns the number of items in a node list.
606 <SEEALSO value="SXP_getNodeListItem"/>
609 <ENTRY id="SXP_getNodeListItem">
610 <TYPE value="Functions"/>
612 SXP_getNodeListItem(list, index)
613 <PARAM name="list" type="SXP_NodeList">
616 <PARAM name="index" type="int">
617 A zero-based index into the list.
619 <PARAM name="(RET)" type="int">
624 Returns the item at the given (zero-based) position in the node list.
626 <SEEALSO value="SXP_getNodeListLength"/>
635 <ENTRY id="DOMHandler">
636 <TYPE value="Callbacks"/>
638 A structure holding the addresses of all the callback functions
639 that reveal the DOM document to the SXP. It contains the following
640 callbacks (in the given order):
643 <li> <C>getNodeType</C>,
644 <li> <C>getNodeName</C>,
645 <li> <C>getNodeNameURI</C>,
646 <li> <C>getNodeNameLocal</C>,
647 <li> <C>getNodeValue</C>,
648 <li> <C>getNextSibling</C>,
649 <li> <C>getPreviousSibling</C>,
650 <li> <C>getNextAttrNS</C>,
651 <li> <C>getPreviousAttrNS</C>,
652 <li> <C>getChildCount</C>,
653 <li> <C>getAttributeCount</C>,
654 <li> <C>getNamespaceCount</C>,
655 <li> <C>getChildNo</C>,
656 <li> <C>getAttributeNo</C>,
657 <li> <C>getNamespaceNo</C>,
658 <li> <C>getParent</C>,
659 <li> <C>getOwnerDocument</C>,
660 <li> <C>compareNodes</C>,
661 <li> <C>retrieveDocument</C>.
666 <ENTRY id="getNodeType">
667 <TYPE value="Callbacks"/>
670 <PARAM name="node" type="SXP_Node">
671 The node to operate on.
673 <PARAM name="(RET)" type="SXP_NodeType">
674 The type of the node.
678 Returns the type of the given node, or SXP_NONE on error.
682 <ENTRY id="getNodeName">
683 <TYPE value="Callbacks"/>
686 <PARAM name="node" type="SXP_Node">
687 The node to operate on.
689 <PARAM name="(RET)" type="const SXP_char*">
690 The name of the node.
694 Returns the qualified name of the given node (prefix:local-part). On error, returns NULL.
698 <ENTRY id="getNodeNameURI">
699 <TYPE value="Callbacks"/>
702 <PARAM name="node" type="SXP_Node">
703 The node to operate on.
705 <PARAM name="(RET)" type="const SXP_char*">
706 The URI of the node's namespace.
710 Returns the namespace URI of the given node. On error, returns NULL.
714 <ENTRY id="getNodeNameLocal">
715 <TYPE value="Callbacks"/>
717 getNodeNameLocal(node)
718 <PARAM name="node" type="SXP_Node">
719 The node to operate on.
721 <PARAM name="(RET)" type="const SXP_char*">
722 The local name of the node.
726 Returns the local part of the given node's name. On error, returns NULL.
730 <ENTRY id="getNodeValue">
731 <TYPE value="Callbacks"/>
734 <PARAM name="node" type="SXP_Node">
735 The node to operate on.
737 <PARAM name="(RET)" type="const SXP_char*">
738 The value of the node.
742 Returns the value of the given node, or NULL on error. The node
743 values are as specified in the DOM Level 1 Core specification,
744 with the addition that the value of a namespace node is the
749 <ENTRY id="getNextSibling">
750 <TYPE value="Callbacks"/>
753 <PARAM name="node" type="SXP_Node">
754 The node to operate on.
756 <PARAM name="(RET)" type="SXP_Node">
757 The next sibling of the node.
761 Returns the following sibling of the node, in document order. If
762 there is no such sibling, returns NULL. If the node is an
763 attribute or a namespace node, NULL is returned.
766 In the early versions of the SXP, <C>getNextSibling</C> acted
767 like <C>getNextAttrNS</C> when used on attributes and namespace
772 <ENTRY id="getPreviousSibling">
773 <TYPE value="Callbacks"/>
775 getPreviousSibling(node)
776 <PARAM name="node" type="SXP_Node">
777 The node to operate on.
779 <PARAM name="(RET)" type="SXP_Node">
780 The preceding sibling of the node.
784 Returns the preceding sibling of the node, in document order. If
785 there is no such sibling, returns NULL. If the node is an
786 attribute or a namespace node, NULL is returned.
789 In the early versions of the SXP, <C>getPreviousSibling</C> acted
790 like <C>getPreviousAttrNS</C> when used on attributes and namespace
795 <ENTRY id="getNextAttrNS">
796 <TYPE value="Callbacks"/>
799 <PARAM name="node" type="SXP_Node">
800 The node to operate on.
802 <PARAM name="(RET)" type="SXP_Node">
803 The attribute/namespace node after the given one.
807 If the given node is an attribute, the following attribute is
808 returned; if it is a namespace node, the following namespace node
809 is returned. If the node is not of these two types, or if there is
810 no following node of the same type, the callback returns NULL.
814 <ENTRY id="getPreviousAttrNS">
815 <TYPE value="Callbacks"/>
817 getPreviousAttrNS(node)
818 <PARAM name="node" type="SXP_Node">
819 The node to operate on.
821 <PARAM name="(RET)" type="SXP_Node">
822 The attribute/namespace node preceding the given one.
826 If the given node is an attribute, the preceding attribute is
827 returned; if it is a namespace node, the preceding namespace node
828 is returned. If the node is not of these two types, or if there is
829 no preceding node of the same type, the callback returns NULL.
833 <ENTRY id="getChildCount">
834 <TYPE value="Callbacks"/>
837 <PARAM name="node" type="SXP_Node">
838 The node to operate on.
840 <PARAM name="(RET)" type="int">
841 The number of children of the node.
845 Returns the number of children of the node. In particular, if the
846 node is neither an element nor a document node, 0 is returned.
850 <ENTRY id="getAttributeCount">
851 <TYPE value="Callbacks"/>
853 getAttributeCount(node)
854 <PARAM name="node" type="SXP_Node">
855 The node to operate on.
857 <PARAM name="(RET)" type="int">
858 The number of attributes of the node.
862 Returns the number of attributes of the node. In particular, if the
863 node is not an element, 0 is returned.
867 <ENTRY id="getNamespaceCount">
868 <TYPE value="Callbacks"/>
870 getNamespaceCount(node)
871 <PARAM name="node" type="SXP_Node">
872 The node to operate on.
874 <PARAM name="(RET)" type="int">
875 The number of namespace declarations belonging to the node.
879 Returns the number of namespace declarations belonging to the node. In particular, if the
880 node is not an element, 0 is returned.
884 <ENTRY id="getChildNo">
885 <TYPE value="Callbacks"/>
887 getChildNo(node, index)
888 <PARAM name="node" type="SXP_Node">
889 The node to operate on.
891 <PARAM name="index" type="int">
894 <PARAM name="(RET)" type="SXP_Node">
895 The node's child with the given index.
899 Returns the node's child at the given index. If the index is
900 out of bounds, or if the node has no children, NULL is returned.
904 <ENTRY id="getAttributeNo">
905 <TYPE value="Callbacks"/>
907 getAttributeNo(node, index)
908 <PARAM name="node" type="SXP_Node">
909 The node to operate on.
911 <PARAM name="index" type="int">
912 Index of an attribute.
914 <PARAM name="(RET)" type="SXP_Node">
915 The node's attribute with the given index.
919 Returns the node's attribute at the given index. If the index is
920 out of bounds, or if the node has no attributes, NULL is returned.
924 <ENTRY id="getNamespaceNo">
925 <TYPE value="Callbacks"/>
927 getNamespaceNo(node, index)
928 <PARAM name="node" type="SXP_Node">
929 The node to operate on.
931 <PARAM name="index" type="int">
932 Index of a namespace node.
934 <PARAM name="(RET)" type="SXP_Node">
935 The namespace node with the given index among those belonging
940 Returns the namespace node which appears at the given position
941 among those belonging to the given node. If the index is
942 out of bounds, or if the node has no namespace nodes, NULL is returned.
946 <ENTRY id="getParent">
947 <TYPE value="Callbacks"/>
950 <PARAM name="node" type="SXP_Node">
951 The node to operate on.
953 <PARAM name="(RET)" type="SXP_Node">
958 Returns the given node's parent. If the node has no parent
959 (i.e. is a SXP_Document), NULL is returned.
963 <ENTRY id="getOwnerDocument">
964 <TYPE value="Callbacks"/>
966 getOwnerDocument(node)
967 <PARAM name="node" type="SXP_Node">
968 The node to operate on.
970 <PARAM name="(RET)" type="SXP_Document">
975 Returns the given node's owner document.
979 <ENTRY id="compareNodes">
980 <TYPE value="Callbacks"/>
982 compareNodes(node1,node2)
983 <PARAM name="node1" type="SXP_Node">
984 The first node to be compared.
986 <PARAM name="node2" type="SXP_Node">
987 The second node to be compared.
989 <PARAM name="(RET)" type="int">
990 The result of the comparison.
994 Compares two nodes based on the document order. Returns -1 if
995 node1 < node2 in this order, +1 if node1 > node2, and 0 if
996 the nodes are identical. Any other value signifies an error.
1000 <ENTRY id="retrieveDocument">
1001 <TYPE value="Callbacks"/>
1003 retrieveDocument(uri)
1004 <PARAM name="uri" type="const SXP_char*">
1005 The URI of the document to be retrieved.
1007 <PARAM name="(RET)" type="SXP_Document">
1008 The retrieved document.
1012 Returns the document found at the given URI. If the document could
1013 not be retrieved, NULL is returned.