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

merged 1 commit into from Jun 8, 2016


Copy link

@jimhester 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.

@jimhester jimhester force-pushed the bugfix/xml_attrs-attribute_node branch from a2bd10a to 926f305 Compare Jun 2, 2016
@hadley hadley merged commit 65370f8 into r-lib:master Jun 8, 2016
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

2 participants