in reply to Re^4: Couldn't create file parser context for file "somename.xml"
in thread Couldn’t create file parser context for file "somename.xml"

You're telling XML::Parser to open
/cygdrive/D/Perl-Implementaion/ParseXML/bb.xml
and
/cygdrive/D/Perl-Implementaion/ParseXML/bbCopy.xml

but the files you want to open are
D:\Perl-Implementaion\ParseXML\test\bb.xml
and
D:\Perl-Implementaion\ParseXML\test\bbCopy.xml

Notice the missing "test". Fix:

my @files = map "$path/$_", grep /\.xml\z/, readdir(DIR);

Replies are listed 'Best First'.
Re^6: Couldn't create file parser context for file "somename.xml"
by laleh-poly (Novice) on Dec 31, 2009 at 21:02 UTC
    Hi, Thanks!!! I added the "map.." part and it worked. But what was wrong with my code? you are telling that I am telling XML::Parser to open
    /cygdrive/D/Perl-Implementaion/ParseXML/bb.xml
    and
    /cygdrive/D/Perl-Implementaion/ParseXML/bbCopy.xml
    But I pass the address of the directory in which the files are located as a parameter to my script:
    perl parseXML.pl "D:\Perl-Implementaion\ParseXML\test"
    So what is wrong in this??
      Yes but you don't pass the name of that directory to XML::LibXML.