xml-to-array
xml-to-array copied to clipboard
Illegal string offset 'xsl:output'
Hi! I want to parse a XML but this tag is generated a Exception
[ErrorException]
Illegal string offset 'xsl:output'
This is the original file. cadenaoriginal_3_3.zip
In XmlToArray::convertDomElement
- I'm temporarily omit comments.
- I think the detail is that if a
DOMTextis detected, the variable$resultis replaced by a string and it can no longer be assigned as an array.
+1 PHP Warning: Illegal string offset 'oemmodelcode' in /var/www/vendor/vyuldashev/xml-to-array/src/XmlToArray.php on line 63
+1 ErrorException (E_WARNING) Illegal string offset 'hlword'
Hello, this package can transform simple xml files. I might find some time to tweak it. Any help will be appreciated.
Also, I think xls will be supported.
@Zolotov88 @ALiSHERBE can you send xml examples?
<?xml version="1.0"?>
<root>
<Good_guy>
<name>Luke Skywalker</name>
<weapon>Lightsaber</weapon>
</Good_guy>
<Bad_guy>
<name>Sauron</name>
<weapon>Evil Eye</weapon>
</Bad_guy>
</root>
Dies on
string(5) "
"
Formatting messes things up. Pass in the string without whitespaces, new lines and carrigage returns.
<items><good_guy><name>Luke Skywalker</name><weapon>Lightsaber</weapon></good_guy><bad_guy><name>Sauron</name><weapon>Evil Eye</weapon></bad_guy></items>