diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-04-01 12:26:27 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-04-01 12:26:27 +0100 |
| commit | d99c29f5bf1b597f7fb2c823d7894032f6c17010 (patch) | |
| tree | ac7fa9b799ec7e2b3a088ade7826cf5d7f2baf4b /lib/xmlreader.js | |
| parent | 6a9f7140a8f67a9af33c30dbd0acd61496ba1e91 (diff) | |
Add reading of run properties element
Diffstat (limited to 'lib/xmlreader.js')
| -rw-r--r-- | lib/xmlreader.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/xmlreader.js b/lib/xmlreader.js index 67dda38..3efad63 100644 --- a/lib/xmlreader.js +++ b/lib/xmlreader.js @@ -3,6 +3,7 @@ var sax = require("sax"); var _ = require("underscore"); exports.read = read; +exports.Element = Element; function read(xmlString) { var parser = sax.parser(true, {xmlns: true, position: false}); @@ -61,11 +62,11 @@ function mapValues(input, mapper, context) { }, {}, context); } -function Element(name, attributes) { +function Element(name, attributes, children) { this.type = "element"; this.name = name; this.attributes = attributes; - this.children = []; + this.children = children || []; } Element.prototype.first = function(name) { |
