You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The condition for isContentNode in XMLNode>>#inspectTreeIn: is reversed, so something that has descendantElements (which is only XMLNodeWithElements) always gets no children in the tree, making the tree always have only 1 level. Inversely, anything else, that cannot have any descendants, like XMLAttribute, tries to get these descendantElements, still resulting in an error that the commit attempted to fix.
The fix only works for XMLString, as it returns true for isContentNode, so it does not try to return children as well.
I believe one of the following can be done:
Option 1:
remove isContentNode from XMLString, therefore not considering it a content node anymore (which might not be a correct thing to do, don't know the intended semantics for what is considered a "content node" and reasons why this method exists)
swap contents of ifTrue: and ifFalse: blocks in XMLNode>>#inspectTreeIn:
Option 2:
introduce another typecheck-like testing method, named for example "canHaveDescendantElements", that would return false for XMLNode, true for XMLNodeWithElements (therefore XMLString would also return false)
use this canHaveDescendantElements instead of isContentNode in the condition in XMLNode>>#inspectTreeIn:
swap contents of ifTrue: and ifFalse: blocks in XMLNode>>#inspectTreeIn:
Option 3:
Create method descendantElements in XMLNode that would return an empty array
remove the condition in XMLNode>>#inspectTreeIn: altogether and always get descendantElements
The text was updated successfully, but these errors were encountered:
There are multiple issues caused by b55512b
The condition for
isContentNode
inXMLNode>>#inspectTreeIn:
is reversed, so something that hasdescendantElements
(which is onlyXMLNodeWithElements
) always gets no children in the tree, making the tree always have only 1 level. Inversely, anything else, that cannot have any descendants, likeXMLAttribute
, tries to get thesedescendantElements
, still resulting in an error that the commit attempted to fix.The fix only works for
XMLString
, as it returns true forisContentNode
, so it does not try to return children as well.I believe one of the following can be done:
Option 1:
isContentNode
fromXMLString
, therefore not considering it a content node anymore (which might not be a correct thing to do, don't know the intended semantics for what is considered a "content node" and reasons why this method exists)ifTrue:
andifFalse:
blocks inXMLNode>>#inspectTreeIn:
Option 2:
canHaveDescendantElements
", that would return false forXMLNode
, true forXMLNodeWithElements
(thereforeXMLString
would also return false)canHaveDescendantElements
instead ofisContentNode
in the condition inXMLNode>>#inspectTreeIn:
ifTrue:
andifFalse:
blocks inXMLNode>>#inspectTreeIn:
Option 3:
descendantElements
inXMLNode
that would return an empty arrayXMLNode>>#inspectTreeIn:
altogether and always getdescendantElements
The text was updated successfully, but these errors were encountered: