jey_suresh has asked for the wisdom of the Perl Monks concerning the following question:

Dear group,

This is relevant to all those that might be contemplating a dabble with XML in Perl.
This is the target architecture:
MS-Win2K Professional
Active-Perl 5.10 Build 1002

The mission is to get XML::LibXML installed and running on the target mentioned above. Steps I followed:

Kindly Note: The PPM approach did not work, so please do not recommend that option to me. Our company firewall blocks online installs and offline install does not work either. I am presently communicating with Randy Kobes, ye good man that hails from Winnipeg, on this matter for sometime now. We are pretty much scraping the bottom of the barrel on PPM installs.

1. Installed the libxml2, iconv and zlibc libraries for Win32 from _the_ popular source: http://www.zlatkovic.com/libxml.en.html -> and links from therein for the other sources.
2. The MakeMaker is unable to identify the libxml2 installation, so modify the Makefile.PL to disable all validations for lib*xml*. Then generate the Makefile with the usual magic incantations.

MY_HOME:> perl makefile.PL INC="-IC:\Perl\lib\libxml2\include -IC: +\Progra~1\Micros~3\VC98\Include -IC:\Progra~1\GnuWin32\include" LIBS= +"-LC:\Perl\lib\libxml2\lib -LC:\Progra~1\GnuWin32\lib"
This is the only way that one can generate the Makefile proper.
3. Then, manually add many of the lib files needed for a successful make into the $EXTRALIBS and $LDLOADLIBS vars. Some examples:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi +32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
There are more!
4. Now run nmake and nmake install.
5. For the XML-Common package, steps 2 and 3 yield the appropriate results. The files are also copied into the relevant areas.
6. For XML-LibXML, step 3 fails with the following error: Here follows a portion of the nmake output follows: Please read through it for my annotations
/****** Lots of other details go here ******/ Running Mkbootstrap for XML::LibXML () C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 LibXML.bs li +nk -out:blib\arch\auto\XML\LibXML\LibXML.dll -dll -nologo ^^^^^^^^^^^^^A new libXML is getting created^^^^^^^^^^^^^ -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -m +achine:x86 Av_CharPtrPtr.obj LibXML.obj dom.obj perl-libxml-mm.obj + perl-libxml-sax.obj xpath.obj C:\Perl\lib\CORE\perl510.lib C:\Pe +rl\lib\libxml2\lib\libxml2.lib ^^^^^^^^^^^^^^^^^^Inclusion of library here!^^^^^^^ C:\PROGRA~1\MICROS~3\VC98\LIB\oldnames.lib C:\PROGRA~1\MICROS~3\VC98\L +IB\kernel32.lib /****** Lots of other details go here ******/
7. further, "nmake install" leads to another FATAL error. A dialog box pops up with message: "xmltestReaderSetSchema could not be found in libxml2.dll" - meaning libxml2 was looked up, but not loaded or vice versa. From here, it is downhill all the way!
8. A sample program to test if the library is installed and invoked successfully, leads to this error:

> "C:\Perl\bin\perl5.10.0.exe" Part3a.pl Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XM +L::LibXML: load_file:The specified procedure could not be found at C: +/Perl/lib/DynaLoader.pm line 201. at C:/Perl/site/lib/XML/LibXML.pm line 116 BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/LibXML.pm li +ne 116. Compilation failed in require at RosieStock.pm line 3. BEGIN failed--compilation aborted at RosieStock.pm line 3. Compilation failed in require at Part3a.pl line 4. BEGIN failed--compilation aborted at Part3a.pl line 4. > Terminated with exit code 9.

As you can see. it is like running on a Hamster wheel! All work and no play, yields us no package :-(.
Any constructive suggestions and inputs from anybody on this matter is more than welcome and will be greatly appreciated. If someone wishes to add to this, that will be of use for me as well. If you need more data, please ask and I will be happy to add them in subsequent threads.

Many thanks if you have read this far. Thank you all even more, should you decide to reply to this post.

Best wishes,
Suresh.

Updates for original post: June 10, 2008

Thanks for all your suggestions to the post and in the chat session earlier: Here's the outcome of the suggestions

1. Upon searching, I found multiple instances of "libxml2.dll" on the PC. Edited the PATH variable to reflect only the one path containing libxml2.dll.
Unfortunately this attempt also did not work, and we got the same old error of:  Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' or Common.dll depending on the PC where the exercise was being conducted.

2a. XML::LibXML and the libxml2.dll ship (as standard) with the latest Strawberry Perl.
As per Rob's suggestion - installed Strawberry Perl and tried to run a test script. Still no joy and the same error is being encountered

Can't load 'D:/Strawberry/Perl/site/lib/auto/XML/LibXML/LibXML.dll' fo +r module XML::LibXML: load_file:The specified procedure could not be +found at D:/Strawberry/Perl/lib/DynaLoader.pm line 201. at D:/Strawberry/Perl/site/lib/XML/LibXML.pm line 116 BEGIN failed--compilation aborted at D:/Strawberry/Perl/site/lib/XML/L +ibXML.pm line 116.

On another test PC, the same test bails out with errors encountered in Common.dll itself!.

2b.Assuming strawberry has been placed in it's default location, run:
set PATH=C:\strawberry\c\bin;%PATH%
As per the second suggestion, re-edited the PATH variable and added only the strawberry paths first. This resulted in script failing due to the dependency on LibXSLT. Managed to get that installed on the activeState Perl installation after a lot of callisthenics! We reasoned that if after we get this sorted, it is a simple matter of copying the necessary files back into strawberry/ActiveState as the need arises.
But, after installing LibXSLT in ActivePerl, even Strawberry perl started throwing up the error that was being throw originally, i.e.,  Can't load..........   LibXML.dll! (God! What a truly unholy mess this is turning out to be!)

3. Apologies for mis-typing "xmlTextReaderSetSchema" in the first post. That was helpful for the search, but editing the paths and including only the relevant path for libxml2 did not help.

4. I am aware of the http_proxy variable and I have already set it up on my PC. In spite of giving full path, ppm reports the 404...not found error!

Still in square one and still in bad shape. Anyone else got lucky with LibXML on a 5.10 install? Would you be willing to share your knowledge with us, please?

#---- [EOF] --------------- [EOF]-----------------------

Replies are listed 'Best First'.
Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by moritz (Cardinal) on Jun 09, 2008 at 15:00 UTC
    It looks to me like your libxml2 installation is broken. That would explain why MakeMaker and DynaLoader don't recognize it, and subsequently the installation fails.

    I know next to nothing about dynamic objects on windows, so all I can try to suggest is reinstalling it from different sources.

    I'd also recommend strongly to run make test before make install.

Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by syphilis (Archbishop) on Jun 10, 2008 at 00:48 UTC
    XML::LibXML and the libxml2.dll ship (as standard) with the latest Strawberry Perl. I haven't personally tested them, but I've no reason to doubt that they function perfectly well. You could even copy the XML::LibXML installation (including the libxml2.dll) from Strawberry across to ActivePerl if, for some reason, you're committed to ActivePerl.

    Cheers,
    Rob
Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by syphilis (Archbishop) on Jun 10, 2008 at 07:29 UTC
    .. installed Strawberry Perl and tried to run a test script. Still no joy and the same error is being encountered

    Assuming strawberry has been placed in it's default location, run:
    set PATH=C:\strawberry\c\bin;%PATH%
    Then re-run the script. That should ensure that the correct libxml2.dll gets found. (If the script still fails with the same error I'll be truly amazed.)

    Cheers,
    Rob
Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by Anonymous Monk on Jun 10, 2008 at 06:42 UTC
    C:\Perl\lib\libxml2\include
    perl -V:archlib is for core perl modules only (no core module libml2::include).

    7. further, "nmake install" leads to another FATAL error. A dialog box pops up with message: "xmltestReaderSetSchema could not be found in libxml2.dll" - meaning libxml2 was looked up, but not loaded or vice versa. From here, it is downhill all the way!
    I can't find the string xmltestReaderSetSchema anywhere in either XML-LibXML or libxml2 sources. Its important that you copy/paste error messages. If you did, you could search for perl libxml2 xmlTextReaderSetSchema and find your answer already

    Then, manually add many of the lib files needed for a successful make into the $EXTRALIBS and $LDLOADLIBS vars.

    “Danger, Will Robinson!” You are never supposed to do that yourself.

Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by Anonymous Monk on Jun 10, 2008 at 07:18 UTC
    PPM doesn't work through a proxy/firewall.
    This can be remedied by setting the environment variable 'HTTP_proxy' to the name and port of your Internet proxy, e.g.:
    C:\> set HTTP_proxy=http://proxy:8080
    If your proxy or firewall requires a username and password, you will also need to set the environment variables 'HTTP_proxy_user' and 'HTTP_proxy_pass'.

Re: Problems installing XML::LibXML for Perl5.10 on Win32 platform
by Anonymous Monk on Jun 10, 2008 at 06:12 UTC
    ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/XML-LibXML.ppd