in reply to Re^4: Error with .xml file processing in XML::Simple
in thread Error with .xml file processing in XML::Simple

Hi,

Thanks for the reply. I tried using another "lib" (to the current folder), but that didn't work either.

Guess I'll just have to contact the host, and see if they can suggest anything.

Thanks for the reply though :)

Cheers

Andy
  • Comment on Re^5: Error with .xml file processing in XML::Simple

Replies are listed 'Best First'.
Re^6: Error with .xml file processing in XML::Simple
by almut (Canon) on Feb 17, 2009 at 10:47 UTC
    I tried using another "lib" (to the current folder)

    From looking at the above code I'd say that "use lib qw(.)" shouldn't be necessary and wouldn't help.  It should simply work if the file is found in the current directory.

    And if you use lib qw(/some/path), the file would need to be located in /some/path/XML/Parser/Encodings/ — IOW, if /some/path is '.', the file would need to be put in ./XML/Parser/Encodings/.

    (Also make sure that the webserver can access the directory.)

Re^6: Error with .xml file processing in XML::Simple
by Bloodnok (Vicar) on Feb 17, 2009 at 11:09 UTC
    Unless you've modified it elsewhere in your script &/or environment, @INC already contains the current directory i.e. ..

    A user level that continues to overstate my experience :-))
      Mmm weird - well, the file is certainly in the same directory, but its still fataling out :( Cheers Andy
      Ah, just realised a silly mistake :P It wasn't called .enc :P

      Anyway, renamed it - and now get this error:

      <pre>./iso-8859-15.enc isn't an encmap file at /usr/lib/perl5/vendor_p +erl/5.8.4/x86_64-linux/XML/Parser.pm line 187 </pre> <p> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. </p> [Tue Feb 17 07:09:51 2009] import.cgi: ./iso-8859-15.enc isn't an encm +ap file at /usr/lib/perl5/vendor_perl/5.8.4/x86_64-linux/XML/Parser.p +m line 187


      Any more suggestions?

      TIA!

      Andy

        This is what the README has to say about the .enc files:

        These maps were generated by a perl script that comes with the module XML::Encoding, compile_encoding, from XML formatted encoding maps that are distributed with that module. These XML encoding maps were generat +ed in turn with a different script, domap, from mapping information conta +ined on the Unicode version 2.0 CD-ROM. This CD-ROM comes with the Unicode Standard reference manual and can be ordered from the Unicode Consorti +um at http://www.unicode.org. The identical information is available on t +he internet at ftp://ftp.unicode.org/Public/MAPPINGS.

        so, my guess would be that you have to run your 8859-15.TXT file through these two scripts...

        Or, take the easy way out, and redeclare your XML input to be in ISO-8859-1 :)

        ISO-8859-1 is pretty close to ISO-8859-15, but you wouldn't have the Euro sign, for example. See ISO-8859-15 for an exact list of differences.  Depending on what the end output is of your processing chain (i.e., if it's still in ISO-Latin* single-byte encoding, and not something like UTF-8), it might work if you simply redeclare it back to ISO-8859-15 when done.

        ___

        Side note: please don't use <pre>...</pre> tags - at least not for long lines (use <c>...</c> instead). Most browsers don't auto-wrap those lines, but add horizontal scrollbars instead — in short, the page gets messed up... (Your "<pre>This function looks... </pre>" in Re^3: Error with .xml file processing in XML::Simple is definitely too long for <pre>, and some people would even say that 20 chars is 'long').