laleh-poly has asked for the wisdom of the Perl Monks concerning the following question:
For some files it works fine, but for some other files it gives the error "Couldn’t create file parser context for file "somename.xml": No such a file or directory at... ". For example, I rename a file (for which parsing was successful) and then I rerun my scripts on both files. For the original file it works ok but on the copied one I receive the above mentioned error. However, the content of the two files are exactly the same, and just their names are different. Any idea? Thanks, Lalehif (@files !=0){ foreach $file (@files) { $parser = XML::LibXML->new(); $tree = $parser->parse_file($file); $root = $tree->getDocumentElement; @changes = $root->getElementsByTagName('change'); foreach $change (@changes) { @classDetail = $change->getElementsByTagName('class'); if (@classDetail !=0){ $className=$classDetail[0]->getAttribute('name'); print "className= " .$className ."\n"; } } undef ($parser) } } closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Couldn’t create file parser context for file "somename.xml"
by ahmad (Hermit) on Dec 31, 2009 at 06:30 UTC | |
by laleh-poly (Novice) on Dec 31, 2009 at 18:12 UTC | |
by ikegami (Patriarch) on Dec 31, 2009 at 19:02 UTC | |
by laleh-poly (Novice) on Dec 31, 2009 at 20:00 UTC | |
by ikegami (Patriarch) on Dec 31, 2009 at 20:24 UTC | |
|