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

Only look for attributes for element nodes #99

Merged
merged 1 commit into from Jun 8, 2016

Conversation

@jimhester
Copy link
Member

jimhester commented Jun 2, 2016

Fixes #97

The main issue was for non-element nodes the ns and nsDef structures can be non-null but also invalid as XML_ATTRIBUTE_NODE cannot have its own attributes or namespace definitions. The code assumed they would be NULL but that is clearly not true.

The fix is to only check for attributes if it is an XML_ELEMENT_NODE and return character() otherwise.

One other issue this raises is how we want display non-element nodes. Should format(t1) be "c='1'" or is the previous behavior as <c> sufficient. Most of the time I believe people want to work with element nodes, so probably the previous behavior is fine.

Fixes #97
@jimhester jimhester force-pushed the jimhester:bugfix/xml_attrs-attribute_node branch from a2bd10a to 926f305 Jun 2, 2016
@hadley hadley merged commit 65370f8 into r-lib:master Jun 8, 2016
3 checks passed
3 checks passed
codecov/patch 100% of diff hit (target 74.60%)
Details
codecov/project 74.63% (+<.01%) compared to dd5a661
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.