robrighter / node-xml

An xml parser for node.js written in javascript.
197 stars 59 forks source link

Allow detection of empty elements - Issue #22 #23

Closed kruncher closed 12 years ago

kruncher commented 12 years ago

I have added an additional parameter to callbacks onBeginElementNS and onEndElementNS so that empty elements can be detected when parsing.

For example:

<list>
    <item><item>
    <item />
</list>

The first item is called as follows:

onBeginElementNS('item', {}, null, null, [])
onEndElementNS('item', null, null)

The second item is called as follows:

onBeginElementNS('item', {}, null, null, [], true)
onEndElementNS('item', null, null, true)