interfaces/xpath.idl Source File

xpath.idl
Go to the documentation of this file.
1 // From: http://www.w3.org/TR/DOM-Level-3-XPath/idl-definitions.html
2 // Minor modifications for the CellML API implementation:
3 // * Fix DOM #include to use the filename used in the CellML API.
4 // * Remove W3C pragma, add our pragmas.
5 // * Make this XPath 1.0 specific by removing DOMObject and replacing with
6 // XPathResult, the type according to the XPath DOM specification. Also
7 // added a forward definition for XPathResult to make this valid.
8 // File: xpath.idl
9 
10 #ifndef _XPATH_IDL_
11 #define _XPATH_IDL_
12 
13 #include "DOM_APISPEC.idl"
14 
15 module xpath
16 {
17 
19  typedef dom::Node Node;
21 
22  interface XPathNSResolver;
23  interface XPathExpression;
24  interface XPathResult;
25 
26  exception XPathException {
27  unsigned short code;
28  };
29  // XPathExceptionCode
30  const unsigned short INVALID_EXPRESSION_ERR = 51;
31  const unsigned short TYPE_ERR = 52;
32 
33 
35  XPathExpression createExpression(in DOMString expression,
36  in XPathNSResolver resolver)
37  raises(XPathException,
39  XPathNSResolver createNSResolver(in Node nodeResolver);
40  XPathResult evaluate(in DOMString expression,
41  in Node contextNode,
42  in XPathNSResolver resolver,
43  in unsigned short type,
44  in XPathResult result)
45  raises(XPathException,
47  };
48 #pragma terminal-interface
49 
51  XPathResult evaluate(in Node contextNode,
52  in unsigned short type,
53  in XPathResult result)
54  raises(XPathException,
56  };
57 #pragma terminal-interface
58 
60  DOMString lookupNamespaceURI(in DOMString prefix);
61  };
62 #pragma cross-module-argument
63 
65 
66  // XPathResultType
67  const unsigned short ANY_TYPE = 0;
68  const unsigned short NUMBER_TYPE = 1;
69  const unsigned short STRING_TYPE = 2;
70  const unsigned short BOOLEAN_TYPE = 3;
71  const unsigned short UNORDERED_NODE_ITERATOR_TYPE = 4;
72  const unsigned short ORDERED_NODE_ITERATOR_TYPE = 5;
73  const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
74  const unsigned short ORDERED_NODE_SNAPSHOT_TYPE = 7;
75  const unsigned short ANY_UNORDERED_NODE_TYPE = 8;
76  const unsigned short FIRST_ORDERED_NODE_TYPE = 9;
77 
78  readonly attribute unsigned short resultType;
79  readonly attribute double numberValue;
80  // raises(XPathException) on retrieval
81 
82  readonly attribute DOMString stringValue;
83  // raises(XPathException) on retrieval
84 
85  readonly attribute boolean booleanValue;
86  // raises(XPathException) on retrieval
87 
88  readonly attribute Node singleNodeValue;
89  // raises(XPathException) on retrieval
90 
91  readonly attribute boolean invalidIteratorState;
92  readonly attribute unsigned long snapshotLength;
93  // raises(XPathException) on retrieval
94 
95  Node iterateNext()
96  raises(XPathException,
97  dom::DOMException);
98  Node snapshotItem(in unsigned long index)
99  raises(XPathException);
100  };
101 #pragma terminal-interface
102 
103  interface XPathNamespace : Node {
104 
105  // XPathNodeType
106  const unsigned short XPATH_NAMESPACE_NODE = 13;
107 
108  readonly attribute Element ownerElement;
109  };
110 #pragma terminal-interface
111 };
112 
113 #endif // _XPATH_IDL_