Subject: | Don't open really XMLF |
I think that in the last "else" in "new" method there is the problem:
shift(@_) if($_[0] eq 'filename'); # special-case loading XML file
with non-standard declaration
if(-r $_[0]){ # special-case loading XML file with non-standard
declaration (but doesn't handle inline XML data or IORef yet)
open(XMLF,'<',$_[1]);$xmld = <XMLF>;close(XMLF);$xmld =~
s/(\?>).*/$1\n/; # if provided XML Declaration doesn't seem well-formed, ...
$xmld = qq(<?xml version="1.0" encoding="utf-8"?>\n) unless($xmld
=~ /^<\?xml version="[^"]+" encoding="[^"]+" *\?>\n$/); # ...reset to
Standard
}
open(XMLF,'<',$_[1]) should to be open(XMLF,'<',$_[0]), because the
filename is in $_[0]. So the unless condition have something to check.
Thank you for XML::Tidy,
Simone