[PATCH] Re: Fwd: CPAN Upload: M/MS/MSERGEANT/XML-Parser-2.32.tar.gz
by Steve Hay other posts by this author
Jul 29 2003 9:14AM messages near this date
view in the new Beta List Site
Re: Fwd: CPAN Upload: M/MS/MSERGEANT/XML-Parser-2.32.tar.gz
|
Re: [PATCH] Re: Fwd: CPAN Upload: M/MS/MSERGEANT/XML-Parser-2.32.tar.gz
Matt Sergeant wrote:
> On Mon, 28 Jul 2003, Steve Hay wrote:
>
>
>
> >>2.32
> >>[snip]
> >> - Styles moved to separate .pm files to make loading faster and
> >> ease maintainence
> >>
> >>
> >Unfortunately, I think this change has broken XML::DOM!!!
> >
> >
>
> Bwahahaha, my plan is working :-)
>
> (j/k).
>
>
>
> >XML::DOM works by adding a new "style" to XML::Parser -- it declares a
> >package called XML::Parser::Dom in the main XML/Dom.pm file. Since I
> >upgraded XML::Parser from 2.31 to 2.32 I now find that all the XML::DOM
> >tests fail with the error: "Can't locate XML/Parser/Style/Dom.pm in @INC
> >(...) at C:/perl5/site/lib/XML/Parser.pm line 54."
> >
> >
>
> Grr. This is a broken assumption on the part of the XML::DOM author which
> pokes into the internals of XML::Parser. External Styles are required to
> be declared in a colon separated style of their choosing, not using an
> "in-built" style name.
>
> The fix to XML::DOM is to specify the style as 'XML::Parser::Dom' rather
> than just 'Dom'.
>
I see that there is now a new version of XML::DOM that does exactly this.
>
>
>
> >Either your XML::Parser change needs to be backwards-compatible, or else
> >perhaps a new version of XML::DOM should be released too?
> >
> >
>
> I suppose this will probably cause me a lot of grief due to vast numbers
> of XML::DOM users out there, so I guess I'll be releasing 2.33 relatively
> soon to see what I can do to fix this bug. :-(
>
I hope you'll still release a 2.33 including the attached patch.
Testing the new XML-DOM 1.43 with XML-Parser 2.32 (and Perl 5.8.0) I
found that I had one test failure:
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\dom_jp_print.t 3 1 33.33% 2
As I said in my original mail, XML-DOM includes a XML-Parser-2.31.patch
which makes two changes to XML-Parser: one to Expat.pm and one to
Expat.xs. I found that applying just the Expat.xs change fixes this
test failure, so here's a patch for that against XML-Parser 2.32. It
also fixes a bunch of "signed/unsigned mismatch" and "unreferenced local
variable" warnings produced by VC++ 6.0.
I've also almost found a way to get around the other errors that I get
(see below) when building XML-Parser. If I arrange for XML_STATIC to be
defined when Expat.xs/c gets compiled then <expat.h> sets up the
XMLPARSEAPI macro appropriately for me. So in theory, all I have to do is:
perl Makefile.PL DEFINE=-DXML_STATIC
and it should work fine.
However, that DEFINE doesn't get passed through to the Makefile.PL in
the Expat sub-directory, which is where it's needed! This appears to be
a bug in ExtUtils-MakeMaker on Win32; I've reported that as cpan #3081.
Steve
>
>
>
> >Two more things while wer're at it:
> >
> >XML::DOM 1.42 includes a file called "XML-Parser-2.31.patch". Unless
> >that patch was applied to XML-Parser 2.31 then several of the XML::DOM
> >tests would fail. It would be worth incorporating that patch into your
> >new XML-Parser.
> >
> >Also, I always find that I get a whole slew of errors out of my linker
> >when building XML-Parser:
> >
> >Expat.obj : error LNK2001: unresolved external symbol
> >__imp__XML_SetParamEntityParsing
> >Expat.obj : error LNK2001: unresolved external symbol
> >__imp__XML_SetUnknownEncodingHandler
> >...
> >Expat.obj : error LNK2001: unresolved external symbol
> >__imp__XML_SetStartCdataSectionHandler
> >Expat.obj : error LNK2001: unresolved external symbol
> >__imp__XML_SetEndCdataSectionHandler
> >..\blib\arch\auto\XML\Parser\Expat\Expat.dll : fatal error LNK1120: 39
> >unresolved externals
> >
> >In order to fix this, I've always had to make the following change:
> >
> ># --- START OF PATCH
> >--- Expat.xs.orig 2003-07-27 16:59:56.000000000 +0100
> >+++ Expat.xs 2003-07-28 08:29:47.000000000 +0100
> >@@ -9,7 +9,9 @@
> > **
> > */
> >
> >+#define XMLPARSEAPI(type) type __cdecl
> > #include <expat.h>
> >+#undef XMLPARSEAPI
> >
> > #include "EXTERN.h"
> > #include "perl.h"
> ># --- END OF PATCH ---
> >
> >This is what the expat library source file "xmlparse.c" does under
> >certain circumstances. Presumably, XMLPARSEAPI was defined as above
> >when I built Expat, and needs to be defined similarly when I build
> >XML-Parser (otherwise XMLPARSEAPI gets defined differently by <expat.h>
> >itself when that gets included). I assume that always #define'ing
> >XMLPARSEAPI as above will break other setups, but copying the #ifdef's
> >from "xmlparse.c" into Expat.xs doesn't fix it for me, probably because
> >I used the DevStudio Project to build Expat itself, but I build
> >XML-Parser by the usual command-line means.
> >
> >If anyone knows how to fix this "properly" it'd be appreciated.
> >
> >
>
> Ditto that.
>
>
>
Attachments:
patch.txt
Thread:
Matt Sergeant
Michel Rodriguez
Steve Hay
Matt Sergeant
Steve Hay
Matt Sergeant
|