Skip to content

Commit

Permalink
Merge branch 'SmallAiTT-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Garrett Johnson committed Oct 21, 2014
2 parents 9d131bb + ebf139a commit cdf1582
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function parse(xml) {

function tag() {
debug('tag %j', xml);
var m = match(/^<([\w+:]+)\s*/);
var m = match(/^<([\w+:.]+)\s*/);
if (!m) return;

// name
Expand Down Expand Up @@ -103,7 +103,7 @@ function parse(xml) {
}

// closing
match(/^<\/[\w:]+>\s*/);
match(/^<\/[\w:.]+>\s*/);

return node;
}
Expand Down
32 changes: 32 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,35 @@ it('should support attributes with a hyphen', function () {
content: "foo"
})
})

it('should support tags with a dot', function () {
var node = parse('<root><c:Key.Columns><o:Column Ref="ol1"/></c:Key.Columns><c:Key.Columns><o:Column Ref="ol2"/></c:Key.Columns></root>');
node.root.should.eql({
name: "root",
attributes: {},
children: [{
name: "c:Key.Columns",
attributes: {},
children: [{
name: "o:Column",
attributes: {
Ref: "ol1"
},
children: []
}],
content: ""
}, {
name: "c:Key.Columns",
attributes: {},
children: [{
name: "o:Column",
attributes: {
"Ref": "ol2"
},
children: []
}],
content: ""
}],
content: ""
})
})

0 comments on commit cdf1582

Please sign in to comment.