-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
40 lines (35 loc) · 850 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
define(['exports', 'module',
'./lib/document',
'./lib/utils'],
function(exports, module, Document, utils) {
/**
* Returns an XML document with usable building and traversing functions.
*
* Examples:
*
* xml('body');
*
* xml('message', { to: 'romeo', from: 'juliet' });
*
* xml('http://www.w3.org/1999/xhtml', 'div', { id: 'foo' });
*
* @param {String} ns
* @param {String} name
* @param {Object} attrs
* @return {Document} XML document wrapper
* @api public
*/
function xml(ns, name, attrs) {
return new Document(ns, name, attrs);
}
/**
* Expose document factory.
*/
exports = module.exports = xml;
exports.Document = Document;
/**
* Expose utilities.
*/
exports.parse = utils.parse;
exports.stringify = utils.stringify;
});