auto xml = `<?xml version="1.0" encoding="UTF-8"?><tag></tag>`;
auto domBuilder = lexer(xml).parser().cursor().domBuilder();
domBuilder.buildRecursive();
auto dom = domBuilder.getDocument();
assert(dom.childNodes.length == 1); // length is actually 0
This succeeds
auto xml = `<?xml version="1.0" encoding="UTF-8"?><tag/>`;
auto domBuilder = lexer(xml).parser().cursor().domBuilder();
domBuilder.buildRecursive();
auto dom = domBuilder.getDocument();
assert(dom.childNodes.length == 1);
as does this
auto xml = `<?xml version="1.0" encoding="UTF-8"?><tag>foo</tag>`;
auto domBuilder = lexer(xml).parser().cursor().domBuilder();
domBuilder.buildRecursive();
auto dom = domBuilder.getDocument();
assert(dom.childNodes.length == 1);
Also, adding attributes to the opening tag in the first example has no effect. It still fails.
So, something funny is going on when there's an open and closing tag with nothing between them, and attributes don't seem to have any impact on what's going on.
Copied from original issue: lodo1995/experimental.xml#41
From @jmdavis on January 6, 2017 8:20
This test fails
This succeeds
as does this
Also, adding attributes to the opening tag in the first example has no effect. It still fails.
So, something funny is going on when there's an open and closing tag with nothing between them, and attributes don't seem to have any impact on what's going on.
Copied from original issue: lodo1995/experimental.xml#41