2 * Copyright 2008 The Closure Compiler Authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @fileoverview Definitions for W3C's XML related specifications.
19 * This file depends on w3c_dom2.js.
20 * The whole file has been fully type annotated.
22 * Provides the XML standards from W3C.
24 * XPath - Fully type annotated
25 * XMLHttpRequest - Fully type annotated
27 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html
28 * @see http://www.w3.org/TR/XMLHttpRequest/
29 * @see http://www.w3.org/TR/XMLHttpRequest2/
32 * @author stevey@google.com (Steve Yegge)
38 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathException
40 function XPathException() {}
44 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#INVALID_EXPRESSION_ERR
46 XPathException.INVALID_EXPRESSION_ERR = 52;
50 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TYPE_ERR
52 XPathException.TYPE_ERR = 52;
56 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#
58 XPathException.prototype.code;
62 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
64 function XPathEvaluator() {}
67 * @param {string} expr
68 * @param {?XPathNSResolver=} opt_resolver
69 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createExpression
70 * @throws XPathException
71 * @throws DOMException
73 XPathEvaluator.prototype.createExpression = function(expr, opt_resolver) {};
76 * @param {Node} nodeResolver
77 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createNSResolver
79 XPathEvaluator.prototype.createNSResolver = function(nodeResolver) {};
82 * @param {string} expr
83 * @param {Node} contextNode
84 * @param {?XPathNSResolver=} opt_resolver
85 * @param {?number=} opt_type
86 * @param {*=} opt_result
87 * @return {XPathResult}
88 * @throws XPathException
89 * @throws DOMException
90 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate
92 XPathEvaluator.prototype.evaluate = function(expr, contextNode, opt_resolver,
93 opt_type, opt_result) {};
98 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
100 function XPathExpression() {}
103 * @param {Node} contextNode
104 * @param {number=} opt_type
105 * @param {*=} opt_result
107 * @throws XPathException
108 * @throws DOMException
109 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression-evaluate
111 XPathExpression.prototype.evaluate = function(contextNode, opt_type,
117 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
119 function XPathNSResolver() {}
122 * @param {string} prefix
124 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver-lookupNamespaceURI
126 XPathNSResolver.prototype.lookupNamespaceURI = function(prefix) {};
129 * From http://www.w3.org/TR/xpath
131 * XPath is a language for addressing parts of an XML document, designed to be
132 * used by both XSLT and XPointer.
136 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
138 function XPathResult() {}
141 * @type {boolean} {@see XPathException.TYPE_ERR}
142 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-booleanValue
144 XPathResult.prototype.booleanValue;
147 * @type {boolean} {@see XPathException.TYPE_ERR}
148 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-invalid-iterator-state
150 XPathResult.prototype.invalidInteratorState;
154 * @throws XPathException {@see XPathException.TYPE_ERR}
155 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-numberValue
157 XPathResult.prototype.numberValue;
161 * @throws XPathException {@see XPathException.TYPE_ERR}
162 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-resultType
164 XPathResult.prototype.resultType;
168 * @throws XPathException {@see XPathException.TYPE_ERR}
169 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-singleNodeValue
171 XPathResult.prototype.singleNodeValue;
175 * @throws XPathException {@see XPathException.TYPE_ERR}
176 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshot-length
178 XPathResult.prototype.snapshotLength;
182 * @throws XPathException {@see XPathException.TYPE_ERR}
183 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-stringValue
185 XPathResult.prototype.stringValue;
189 * @throws XPathException {@see XPathException.TYPE_ERR}
190 * @throws DOMException {@see DOMException.INVALID_STATE_ERR}
191 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-iterateNext
193 XPathResult.prototype.iterateNext = function() {};
196 * @param {number} index
198 * @throws XPathException
199 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshotItem
201 XPathResult.prototype.snapshotItem = function(index) {};
205 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-TYPE
207 XPathResult.ANY_TYPE = 0;
211 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-NUMBER-TYPE
213 XPathResult.NUMBER_TYPE = 1;
217 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-STRING-TYPE
219 XPathResult.STRING_TYPE = 2;
223 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-BOOLEAN-TYPE
225 XPathResult.BOOLEAN_TYPE = 3;
229 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-ITERATOR-TYPE
231 XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;
235 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-ITERATOR-TYPE
237 XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;
241 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-SNAPSHOT-TYPE
243 XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;
247 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE
249 XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;
253 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-UNORDERED-NODE-TYPE
255 XPathResult.ANY_UNORDERED_NODE_TYPE = 8;
259 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-FIRST-ORDERED-NODE-TYPE
261 XPathResult.FIRST_ORDERED_NODE_TYPE = 9;
266 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace
268 function XPathNamespace() {}
272 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace-ownerElement
274 XPathNamespace.prototype.ownerElement;
278 * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPATH_NAMESPACE_NODE
280 XPathNamespace.XPATH_NAMESPACE_NODE = 13;
283 * From http://www.w3.org/TR/XMLHttpRequest/
287 * The XMLHttpRequest Object specification defines an API that provides
288 * scripted client functionality for transferring data between a client and a
292 * @implements {EventTarget}
293 * @see http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest-object
295 function XMLHttpRequest() {}
298 * @param {boolean=} opt_useCapture
301 XMLHttpRequest.prototype.addEventListener =
302 function(type, listener, opt_useCapture) {};
305 * @param {boolean=} opt_useCapture
308 XMLHttpRequest.prototype.removeEventListener =
309 function(type, listener, opt_useCapture) {};
312 XMLHttpRequest.prototype.dispatchEvent = function(evt) {};
315 * @param {string} method
316 * @param {string} url
317 * @param {?boolean=} opt_async
318 * @param {?string=} opt_user
319 * @param {?string=} opt_password
320 * @return {undefined}
321 * @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
323 XMLHttpRequest.prototype.open = function(method, url, opt_async, opt_user,
327 * @param {string} header
328 * @param {string} value
329 * @return {undefined}
330 * @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method
332 XMLHttpRequest.prototype.setRequestHeader = function(header, value) {};
335 * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data
336 * @return {undefined}
337 * @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method
339 XMLHttpRequest.prototype.send = function(opt_data) {};
342 * @return {undefined}
343 * @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method
345 XMLHttpRequest.prototype.abort = function() {};
349 * @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method
351 XMLHttpRequest.prototype.getAllResponseHeaders = function() {};
354 * @param {string} header
356 * @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
358 XMLHttpRequest.prototype.getResponseHeader = function(header) {};
362 * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute
364 XMLHttpRequest.prototype.responseText;
368 * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsexml-attribute
370 XMLHttpRequest.prototype.responseXML;
374 * @see http://www.w3.org/TR/XMLHttpRequest/#the-readystate-attribute
376 XMLHttpRequest.prototype.readyState;
380 * @see http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute
382 XMLHttpRequest.prototype.status;
386 * @see http://www.w3.org/TR/XMLHttpRequest/#the-statustext-attribute
388 XMLHttpRequest.prototype.statusText;
392 * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange
394 XMLHttpRequest.prototype.onreadystatechange;
398 * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onerror
400 XMLHttpRequest.prototype.onerror;
403 * The FormData object represents an ordered collection of entries. Each entry
404 * has a name and value.
406 * @param {?Element=} opt_form An optional form to use for constructing the form
409 * @see http://www.w3.org/TR/XMLHttpRequest2/#the-formdata-interface
411 function FormData(opt_form) {}
414 * @param {string} name
415 * @param {Blob|string} value
417 FormData.prototype.append = function(name, value) {};