Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal string offset 'xsl:output' #2

Open
SergioFloresG opened this issue Nov 14, 2017 · 7 comments
Open

Illegal string offset 'xsl:output' #2

SergioFloresG opened this issue Nov 14, 2017 · 7 comments
Assignees

Comments

@SergioFloresG
Copy link

Hi!
I want to parse a XML but this tag is generated a Exception

[ErrorException]
Illegal string offset 'xsl:output'

@SergioFloresG
Copy link
Author

This is the original file.
cadenaoriginal_3_3.zip

In XmlToArray::convertDomElement

  1. I'm temporarily omit comments.
  2. I think the detail is that if a DOMText is detected, the variable $result is replaced by a string and it can no longer be assigned as an array.

@zolotov88
Copy link

+1
PHP Warning: Illegal string offset 'oemmodelcode' in /var/www/vendor/vyuldashev/xml-to-array/src/XmlToArray.php on line 63

@ALiSHERBE
Copy link

+1
ErrorException (E_WARNING)
Illegal string offset 'hlword'

@vyuldashev
Copy link
Owner

Hello, this package can transform simple xml files. I might find some time to tweak it. Any help will be appreciated.

@vyuldashev
Copy link
Owner

Also, I think xls will be supported.

@zolotov88 @ALiSHERBE can you send xml examples?

@ellisgl
Copy link

ellisgl commented Jul 31, 2018

<?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 Luke Skywalker <-- Illegal string offset 'name' --- var_dump($result) =

string(5) "
    "

@ondrejsanetrnik
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants