Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"<tag></tag>" parsed as if it were nothing #41

Open
jmdavis opened this issue Jan 6, 2017 · 1 comment
Open

"<tag></tag>" parsed as if it were nothing #41

jmdavis opened this issue Jan 6, 2017 · 1 comment

Comments

@jmdavis
Copy link

jmdavis commented Jan 6, 2017

This test fails

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.

Kozzi11 pushed a commit to Kozzi11/experimental.xml that referenced this issue Jul 27, 2017
Kozzi11 pushed a commit to Kozzi11/experimental.xml that referenced this issue Jul 27, 2017
Kozzi11 pushed a commit to Kozzi11/experimental.xml that referenced this issue Jul 27, 2017
@wilzbach
Copy link

This issue was moved to dlang-community/experimental.xml#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants