xml-to-array icon indicating copy to clipboard operation
xml-to-array copied to clipboard

formatting XML

Open padosuperstar opened this issue 6 years ago • 1 comments

Hi, if I try to import a formatted xml file(with blank spaces, carriage returns) from a form with file upload, your function will give an error. I managed to fix the issue by adding this before your function: $stringXml = file_get_contents($fileXml->getRealPath()); $stringXml = preg_replace('/(\>)\s*(\<)/m', '$1$2', str_replace(array("\n", "\r"), "", $stringXml));

It's possible to implement this, or something like this directly in your library? Thanks!

padosuperstar avatar Dec 05 '18 16:12 padosuperstar

The test suite of this project is totally wrong. It only tests that an XML converted from an array is actually converted back to the same array bu the library.

It doesn't test at all that an XML string is converted to an array successfully.

ericmorand avatar Feb 27 '19 16:02 ericmorand