Note that there are some explanatory texts on larger screens.

plurals
  1. POflex xml children() method strange behaviour
    primarykey
    data
    text
    <p>I have the following xml declaration:</p> <pre><code>public var reqData:XML = &lt;root&gt; &lt;Requirement ID="REQ-GEN-0.1" title="exigence gen 1" description="blabla 01" testable="true"/&gt; &lt;RequirementSet ID="GUI REQ"&gt; &lt;Requirement ID="REQ-GUI-1.1" title="exigence ihm 1" description="blabla 11" testable="true"/&gt; &lt;Requirement ID="REQ-GUI-1.2" title="exigence ihm 2" description="blabla 12" testable="false"/&gt; &lt;/RequirementSet&gt; &lt;RequirementSet ID="PERF REQ"&gt; &lt;Requirement ID="REQ-PERF-2.1" title="exigence perf 1" description="blabla 21" testable="true"/&gt; &lt;Requirement ID="REQ-PERF-2.2" title="exigence perf 2" description="blabla 22" testable="false"/&gt; &lt;Requirement ID="REQ-PERF-2.3" title="exigence perf 3" description="blabla 23" testable="true"/&gt; &lt;Requirement ID="REQ-PERF-2.4" title="exigence perf 4" description="blabla 24" testable="false"/&gt; &lt;Requirement ID="REQ-PERF-2.5" title="exigence perf 5" description="blabla 25" testable="false"/&gt; &lt;Requirement ID="REQ-PERF-2.6" title="exigence perf 6" description="blabla 26" testable="false"/&gt; &lt;/RequirementSet&gt; &lt;RequirementSet ID="BUS REQ"&gt; &lt;RequirementSet ID="BUS 1 REQ"&gt; &lt;Requirement ID="REQ-BUS-3.1.1" title="exigence bus 1" description="blabla 311" testable="false"/&gt; &lt;Requirement ID="REQ-BUS-3.1.2" title="exigence bus 2" description="blabla 312" testable="true"/&gt; &lt;/RequirementSet&gt; &lt;RequirementSet ID="BUS 2 REQ"&gt; &lt;Requirement ID="REQ-BUS-3.2.1" title="exigence bus3" description="blabla 321" testable="true"/&gt; &lt;/RequirementSet&gt; &lt;RequirementSet ID="BUS 3 REQ"/&gt; &lt;/RequirementSet&gt; &lt;/root&gt;; </code></pre> <p>I populated an advanced datagrid with this xml but the problem is that a requirement isn't detected: <code>&lt;Requirement ID="REQ-BUS-3.2.1" title="exigence bus3" description="blabla 321" testable="true"/&gt;</code></p> <p>I've overriden a method of the HierarchicalData class to see what happenned:</p> <pre><code>override public function canHaveChildren(node:Object):Boolean { if (node is XML &amp;&amp; node != null){ var xmlNode:XML = node as XML; trace("node:"+node); trace("node.children:"+node.children()); trace("xmlNode.name:"+xmlNode.name()); trace("xmlNode.localName:"+xmlNode.localName()); trace("xmlNode.attributes:"+xmlNode.attributes()); trace("xmlNode.attributes:"+xmlNode.nodeKind()); trace("xmlNode.children():"+xmlNode.children()); trace("xmlNode.children().length():"+xmlNode.children().length()); if(xmlNode.children().length()&gt;0){ var xmlNodeChildren:XMLList = xmlNode.children() as XMLList; var xmlNodeFirstChild:XML = xmlNodeChildren[0]; trace("xmlNodeFirstChild:"+xmlNodeFirstChild); trace("xmlNodeFirstChild.name():"+xmlNodeFirstChild.name()); trace("xmlNodeFirstChild.comments():"+xmlNodeFirstChild.comments()); trace("xmlNodeFirstChild.attributes():"+xmlNodeFirstChild.attributes()); trace("xmlNodeFirstChild.nodeKind():"+xmlNodeFirstChild.nodeKind()); trace("xmlNodeFirstChild.descendants():"+xmlNodeFirstChild.descendants()); } } </code></pre> <p>And here is the result (console), that I just don't understand at all:</p> <pre><code>node:&lt;RequirementSet ID="BUS 2 REQ"&gt; &lt;Requirement ID="REQ-BUS-3.2.1" title="exigence bus3" description="blabla 321" testable="true"/&gt; &lt;/RequirementSet&gt; node.children: xmlNode.name:RequirementSet xmlNode.localName:RequirementSet xmlNode.attributes:BUS 2 REQ xmlNode.attributes:element xmlNode.children(): xmlNode.children().length():1 xmlNodeFirstChild: xmlNodeFirstChild.name():Requirement xmlNodeFirstChild.comments(): xmlNodeFirstChild.attributes():REQ-BUS-3.2.1exigence bus3blabla 321true xmlNodeFirstChild.nodeKind():element xmlNodeFirstChild.descendants(): </code></pre> <p>The node isn't detected by the children() method but it exists. The problem is that I can't look at the source code of XML.abc cause it isn't open-source. Can someone tell me what is happenning? Is it a bug or something else?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload