Skip to content

formatting XML #6

@padosuperstar

Description

@padosuperstar

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions