Skip to content

Count of Childs #3

Open
stefanohrmann opened this Issue Jun 30, 2012 · 0 comments

1 participant

@stefanohrmann

I extended you example a little bit to show the issue.

var xml = easy.parse('<root><books><book name="Lord of the Rings">' +
                         '<author name="J. R. R. Tolkien" />' +
                         '<language>English</language>' +
                         '</book><book name="The Simarillion">' +
                         '<author name="J. R. R. Tolkien" />' +
                         '<language>English</language>' +
                      '</book></books></root>');

assert.equal(xml.books.book[0].length, 2);
assert.equal(xml.books.book.length, 2);

The first assert shouldn't assert the correct count of childs. The second one should. A console.log gives imho a strange result:

{ '0': 
   { '0': { '0': {}, '1': [Object] },
     '1': { '0': {}, '1': [Object] } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.