Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes
DOMNamespaceNode
extend fromDOMNode
.This allows for easier data access without having to worry about all possible types all the times:
Given following example,
The result can either be
DOMAttr|DOMNamespaceNode|false
:(Since the xmlns attributes are very hidden away in the dom extension, you'll need to directly fetch it based on exact attribute name.)
Meaning that if you want to use the result of a the
getAttributeNode()
,you might always have to keep in mind the possibility of it being a
DOMNameSpaceNode
:If you are dealing with only one function, this might be OK.
But if you were to build a library around DOM, this becomes quite messy and it works clumsy.
A better solution is to - at least - make
DOMNamespaceNode extends DOMNode
.This way you can at least use the base type:
This PR is in line with the java jaxon implementation:
http://www.cafeconleche.org/jaxen/apidocs/org/jaxen/dom/NamespaceNode.html
An alternative solution might to make it extend DOMAttr. However, I don't think this is the way to go, since you can also fetch the namespaces through xpath. In this case it would make less sense for it to be an attribute: