Closed
Description
I've been trying to use the Magento\Framework\Xml\Parser class and I had some issues with it. It does not behave as it should, or at least how I expected it to. But maybe my assumptions are wrong.
- The
switch
statement in the_xmlToArray
method does not handle the caseXML_CDATA_SECTION_NODE
. So for all the nodes that look like this<node_name><![CDATA[Some data here]]></node_name>
, when converted to array I just see an emptyarray()
instead ofSome data here
. - in the same
switch
and the same method as above, on the caseXML_TEXT_NODE
there is a check to see if the value is empty.if (trim($node->nodeValue)) {...
. The expression is evaluated tofalse
even if the node value is0
. So again when converting a node like<node_name>0</node_name>
I end up with an emptyarray()
instead of0
...which brings be to point 3. - Why is the default value for the
$content
variable an empty array? Shouldn't this be an empty string?
that's all for now. In case I'm using this wrong and the problem is on my side, just let me know and close this issue.
Metadata
Metadata
Assignees
Labels
No labels