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

Allow docs missing a root element to be created and printed. Fixes #121. #126

Merged
merged 1 commit into from Dec 5, 2016

Conversation

Projects
None yet
2 participants
@sjp
Contributor

sjp commented Sep 14, 2016

This fixes the issue described in #121.

This is mostly achieved by checking whether a document has a root element before attempting to print it.

One other minor bugfix is that an xml_document object will now print its children if they were previously absent. An example:

Before:

> library(xml2)
> doc <- xml_new_document()
> root <- xml_add_child(doc, "root")
> doc
{xml_document}

After:

> library(xml2)
> doc <- xml_new_document()
> root <- xml_add_child(doc, "root")
> doc
{xml_document}
<root>
@jimhester

This comment has been minimized.

Member

jimhester commented Dec 5, 2016

This looks good, only thing needed is a short note to NEWS.md explaining the fix and thanking yourself.

@jimhester jimhester merged commit e8a6214 into r-lib:master Dec 5, 2016

1 of 3 checks passed

codecov/patch 68.75% of diff hit (target 77.32%)
Details
codecov/project 77.31% (-0.01%) compared to 92a9ec9
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jimhester

This comment has been minimized.

Member

jimhester commented Dec 5, 2016

Don't worry about the NEWS, I will add it manually.

@sjp

This comment has been minimized.

Contributor

sjp commented Dec 5, 2016

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment