Closed Bug 256691 Opened 21 years ago Closed 21 years ago

E4X: hasSimpleContent can return false for attribute names

Categories

(Rhino Graveyard :: E4X, defect)

head
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(1 file)

Consider the following test case which is based on example from Richard McKinley: var xml = <a attrname="something"> <b> <c/> </b> </a> ; var simple = xml.@attrname.hasSimpleContent(); print (simple); Since xml.@attrname is attribute this should print true in the shell. Instead it prints false. This is rather sensitive to the structure of <a>, even slight alterations restore the original behavior. The bug is also visible in the following example: var xml = <a attrname="something"> <b> <c/> </b> </a> ; print(xml.@attrname == "something"); which prints false since xml == string can only be true if xml.hasSimpleContent() is true and that simple content equals to the string.
For some reasons XmlCursor when it is recreated for the attribute attrname returns true for toFirstChild call in the implementation of XML.hasSimpleContent(). It can be a bug in xmlbeans or something that I do get. In any case the patch forces hasSimpleContent to return true for attribute and pure text cursor fixing the problem.
I committed the fix
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.5R6
Component: Core → E4X
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: