You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm calling $xml = \FluentDOM::load($fname, 'xml', [ \FluentDOM\Loader\Options::ALLOW_FILE => true ]); on a non-existing $fname and then get a valid document with
<?xml version="1.0" encoding="UTF-8"?>
when I call $xml->saveXML().
I checked both the wiki and the source and couldn't find the proper way to catch this besides calling file_exists() or something similar on $fname before calling the loader.
This is more a question than an error.
I'm calling
$xml = \FluentDOM::load($fname, 'xml', [ \FluentDOM\Loader\Options::ALLOW_FILE => true ]);
on a non-existing$fname
and then get a valid document withwhen I call
$xml->saveXML()
.I checked both the wiki and the source and couldn't find the proper way to catch this besides calling
file_exists()
or something similar on$fname
before calling the loader.It would be great if there was a way to somehow check the return-value (TRUE or FALSE) of
$document->load($source, $settings[Options::LIBXML_OPTIONS]);
(https://github.com/ThomasWeinert/FluentDOM/blob/master/src/FluentDOM/Loader/Supports/Libxml.php#L59) or if$document
was returned as NULL when$document-load()
returns FALSE (either always or through an additional loader option).The text was updated successfully, but these errors were encountered: