From robert.lopez@abq.sc.philips.com Tue Oct 1 19:46:15 2002 From: robert.lopez@abq.sc.philips.com (Robert Lopez) Date: Tue, 1 Oct 2002 12:46:15 -0600 (MDT) Subject: [Expat-discuss] expact, make check, no check.h Message-ID: <200210011846.MAA10456@smtphub.abq.sc.philips.com> HP-UX B.11.00 U 9000/800 Situation: database went to 64-bit; converting all apps to 64-bit. Rebuilding apache, apache wanted new expat lib. Building new expat lib, "make check" fails after successful build. Build summary: % pwd /usr/local/build/expat-1.95.5 % mkdir +build % cd +build % ../configure --build=hppa64-hp-hpux11.00 --host=hppa64-hp-hpux11.00 --with-gnu-ld [must use gnu-ld for 64-bit apps compiled with gcc] [configure had not warnings or errors] % make /bin/sh ./libtool --silent --mode=compile hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o lib/xmlparse.lo -c ../lib/xmlparse.c /bin/sh ./libtool --silent --mode=compile hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o lib/xmltok.lo -c ../lib/xmltok.c /bin/sh ./libtool --silent --mode=compile hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o lib/xmlrole.lo -c ../lib/xmlrole.c /bin/sh ./libtool --silent --mode=link hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -no-undefined -version-info 4:0:4 -rpath /usr/local/lib -o libexpat.la lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o xmlwf/xmlwf.o -c ../xmlwf/xmlwf.c hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o xmlwf/xmlfile.o -c ../xmlwf/xmlfile.c hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o xmlwf/codepage.o -c ../xmlwf/codepage.c hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o xmlwf/readfilemap.o -c ../xmlwf/readfilemap.c ../xmlwf/readfilemap.c: In function `filemap': ../xmlwf/readfilemap.c:61: warning: implicit declaration of function `read' ../xmlwf/readfilemap.c:64: warning: implicit declaration of function `close' /bin/sh ./libtool --silent --mode=link hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o xmlwf/xmlwf xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/readfilemap.o libexpat.la % make check hppa64-hp-hpux11.00-gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I../lib -I. -o tests/runtests.o -c ../tests/runtests.c ../tests/runtests.c:2:19: check.h: No such file or directory ../tests/runtests.c: In function `basic_setup': ../tests/runtests.c:19: warning: implicit declaration of function `fail' ../tests/runtests.c: At top level: ../tests/runtests.c:68: warning: return type defaults to `int' ../tests/runtests.c:68: warning: function declaration isn't a prototype ../tests/runtests.c: In function `START_TEST': ../tests/runtests.c:76: warning: control reaches end of non-void function ../tests/runtests.c: At top level: ../tests/runtests.c:80: parse error before "START_TEST" ../tests/runtests.c:81: warning: return type defaults to `int' ../tests/runtests.c:81: warning: function declaration isn't a prototype <...snip...> ../tests/runtests.c:875: warning: implicit declaration of function `srunner_set_fork_status' ../tests/runtests.c:875: `CK_FORK' undeclared (first use in this function) ../tests/runtests.c:875: `CK_NOFORK' undeclared (first use in this function) ../tests/runtests.c:876: warning: implicit declaration of function `srunner_run_all' ../tests/runtests.c:877: warning: implicit declaration of function `srunner_ntests_failed' ../tests/runtests.c:878: warning: implicit declaration of function `srunner_free' ../tests/runtests.c:879: warning: implicit declaration of function `suite_free' make: *** [tests/runtests.o] Error 1 I assume I should not install after the checks/tests failing. Any idea what has gone wrong? From Josh.Martin@abq.sc.philips.com Fri Oct 4 04:31:00 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Thu, 3 Oct 2002 21:31:00 -0600 (MDT) Subject: [Expat-discuss] expact, make check, no check.h Message-ID: <200210040331.g943V0p05401@atoae450.abq.sc.philips.com> > HP-UX B.11.00 U 9000/800 > Situation: database went to 64-bit; converting all apps > to 64-bit. Rebuilding apache, apache wanted new expat > lib. Building new expat lib, "make check" fails after > successful build. > > Build summary: > % pwd > /usr/local/build/expat-1.95.5 > % mkdir +build > % cd +build > % ../configure --build=hppa64-hp-hpux11.00 --host=hppa64-hp-hpux11.00 --with-gnu-ld > [must use gnu-ld for 64-bit apps compiled with gcc] > [configure had not warnings or errors] > % make > % make check > I assume I should not install after the checks/tests > failing. Any idea what has gone wrong? You have to have the Check package installed to run the tests for Expat. You can find the location for this package referenced in tests/README.txt. Expat mailing list readers can ignore the rest of this message. Robert, I have already built, installed, and tested (by hand) a 64-bit version of expat-1.95.5, so this doesn't need to be done again. - Josh From karl@waclawek.net Fri Oct 4 05:30:38 2002 From: karl@waclawek.net (Karl Waclawek) Date: Fri, 4 Oct 2002 00:30:38 -0400 Subject: [Expat-discuss] expact, make check, no check.h References: <200210040331.g943V0p05401@atoae450.abq.sc.philips.com> Message-ID: <002a01c26b5e$caac1bd0$0207a8c0@karl> > > Robert, I have already built, installed, and tested (by hand) a 64-bit > version of expat-1.95.5, so this doesn't need to be done again. > We have an open 64bit related bug, but can't reproduce it: Bug #491986 Charset decoding error (64-bit systems). Since you seem to have a 64bit Expat at hand, and you likely have run the related (regression) tests (see above), am I right to assume that you had no error? Thanks, Karl From karl@waclawek.net Fri Oct 4 05:34:53 2002 From: karl@waclawek.net (Karl Waclawek) Date: Fri, 4 Oct 2002 00:34:53 -0400 Subject: [Expat-discuss] Does Expat 1.95.5 support DTD validating? References: <024e01c266b7$f0a74ea0$84d99e81@BATTER> Message-ID: <00b201c26b5f$6817f1a0$0207a8c0@karl> > As described in the document of 1.95.5, there is a new function XML_UseForeignDTD added. > I am not sure what this function is used for exactly. If the XML document does not specify an external DTD, setting this flag will make Expat request an external DTD anyway, thus allowing you to supply a DTD of your choice. > But my question is that is the new version of Expat a validating parser? No, and there are no plans to make it one. Validation can be built on top of Expat, however. Karl From rajsinha@avaya.com Mon Oct 7 16:13:24 2002 From: rajsinha@avaya.com (Sinha, Raj (Raj)) Date: Mon, 7 Oct 2002 11:13:24 -0400 Subject: [Expat-discuss] leading white spaces, can i work around it Message-ID: <8CA1128D59AD27429985B397118CEDDF3E247D@nj7460avexu1.global.avaya.com> This is a multi-part message in MIME format. ---------------------- multipart/alternative attachment I was looking around to see if there might be a way to allow expat to accept xml files with leading white spaces before the standard line without invoking the XML_ERROR_MISPLACED_XML_PI. =20 I know that it is invalid to do so but this is one of those quirky requests to make the parser less forgiving for this case. =20 Any help appreciated Thanks =20 raj =20 =20 =20 =20 Raj Sinha 1 732 852 2077 1H-318 307 Middletown Lincroft Road Lincroft, NJ 07738-1526 U S =20 =20 ---------------------- multipart/alternative attachment-- From karl@waclawek.net Mon Oct 7 16:54:51 2002 From: karl@waclawek.net (Karl Waclawek) Date: Mon, 7 Oct 2002 11:54:51 -0400 Subject: [Expat-discuss] leading white spaces, can i work around it References: <8CA1128D59AD27429985B397118CEDDF3E247D@nj7460avexu1.global.avaya.com> Message-ID: <008301c26e19$df333cb0$9e539696@citkwaclaww2k> > I was looking around to see if there might be a way to allow expat to > accept xml files with leading white spaces before the standard version="1.0" ?> line without invoking the XML_ERROR_MISPLACED_XML_PI. > I know that it is invalid to do so but this is one of those quirky > requests to make the parser less forgiving for this case. You would have to filter out leading whitespace when copying data to the buffer parsed by Expat. There is no provision for that in Expat itself. Karl From wcrossing@companywatch.net Tue Oct 8 19:06:18 2002 From: wcrossing@companywatch.net (Warren Crossing) Date: Tue, 8 Oct 2002 19:06:18 +0100 Subject: [Expat-discuss] Rebuilding Expat for ActivePerl Message-ID: <77BBB49BC061D211814E00A0C9EA23E32FD56B@COMPANYWATCH> Hi Jeffry, I am also trying to "upgrade" the XML::Parser to use the Expat_1_95_5 static libraries I have XML::Parser 2.31 and XML::Expat:Parser 2.31 installed in correct locations When I run the parser across a xml file I recieve the message Can't find 'boot_XML__Parser__Expat' symbol in c:/Perl/site/lib/auto/XML/Parser/Expat/libExpat.dll at C:\Perl\site\lib\XML\Parser.pm line 15 Compilation failed in require at C:\Perl\site\lib\XML\Parser.pm line 15. BEGIN failed--compilation aborted at C:\Perl\site\lib\XML\Parser.pm line 19. QUESTIONS I have Is this the correct forum to post this issue. Are other having problems doing this? Can we find any docos? Is there a binary incompatability with 1_95_1, do I need to do anything special here? Regards, Warren Crossing. UK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This message is intended only for the addressee and may contain information that is confidential or privileged. Unauthorised use is strictly prohibited and may be unlawful. If you are not the addressee, you should not read, copy, disclose or otherwise use this message, except for the purpose of delivery to the addressee. If you have received this in error, please delete and advise us immediately. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Although Company Watch makes every reasonable effort to keep its network and systems free from viruses, the company accepts no responsibility for computer viruses transmitted through this mail or in any attachments. It is your responsibility to virus scan any attachments we send to you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From karl@waclawek.net Tue Oct 8 20:00:03 2002 From: karl@waclawek.net (Karl Waclawek) Date: Tue, 8 Oct 2002 15:00:03 -0400 Subject: [Expat-discuss] Rebuilding Expat for ActivePerl References: <77BBB49BC061D211814E00A0C9EA23E32FD56B@COMPANYWATCH> Message-ID: <010701c26efc$e8a64560$9e539696@citkwaclaww2k> > Hi Jeffry, > I am also trying to "upgrade" the XML::Parser to use the Expat_1_95_5 static > libraries > I have XML::Parser 2.31 and XML::Expat:Parser 2.31 installed in correct > locations > When I run the parser across a xml file I recieve the message > Can't find 'boot_XML__Parser__Expat' symbol in > c:/Perl/site/lib/auto/XML/Parser/Expat/libExpat.dll at > C:\Perl\site\lib\XML\Parser.pm line 15 > Compilation failed in require at C:\Perl\site\lib\XML\Parser.pm line 15. > BEGIN failed--compilation aborted at C:\Perl\site\lib\XML\Parser.pm line 19. > QUESTIONS I have > Is this the correct forum to post this issue. Are other having problems > doing this? > Can we find any docos? > Is there a binary incompatability with 1_95_1, do I need to do anything > special here? AFAIK, applications working with 1_95_2 should still work with 1_95_5. Don't know about 1_95_1. As far as Perl is concerned - the expert on the team was Clark Cooper, who is not active anymore. Currently we have no one who specializes on the Perl bindings for Expat. However, this is all a volunteer effort, and it often starts out by asking for fixes/features without success, then implementing them oneself, and finally contributing them back to the project. ;-) Karl From fdrake@acm.org Tue Oct 8 21:58:39 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue, 8 Oct 2002 16:58:39 -0400 Subject: [Expat-discuss] Rebuilding Expat for ActivePerl In-Reply-To: <010701c26efc$e8a64560$9e539696@citkwaclaww2k> References: <77BBB49BC061D211814E00A0C9EA23E32FD56B@COMPANYWATCH> <010701c26efc$e8a64560$9e539696@citkwaclaww2k> Message-ID: <15779.18175.768702.441650@grendel.zope.com> Karl Waclawek writes: > AFAIK, applications working with 1_95_2 should still work with 1_95_5. > Don't know about 1_95_1. This may not be binary compatible, though -- a relink is needed on Windows since we don't control how the link table for Expat is built. That means DLLs for different versions of Expat are not "drop in" compatible. SourceForge bug #579144 describes this in slightly more detail: http://sourceforge.net/tracker/index.php?func=detail&aid=579144&group_id=10127&atid=110127 -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From wcrossing@companywatch.net Wed Oct 9 14:30:34 2002 From: wcrossing@companywatch.net (Warren Crossing) Date: Wed, 9 Oct 2002 14:30:34 +0100 Subject: [Expat-discuss] Rebuilding Expat for ActivePerl Message-ID: <77BBB49BC061D211814E00A0C9EA23E32FD56D@COMPANYWATCH> >From my understanding of the current sitch, theres not a lot of clear doco.. but I think... In order to upgrade the parser 2.31 to work with later builds of Expat on win32.. 1. I need to compile Expat_1_95_2 source files into dynamic link library (.dll) using a .DEF file 2. I have to create/get an .xs file XSUB (perlxs) that controls the input/output to the library produced above 3. Then I Compile the .xs using xsubpp and it builds a new library which can work with XML::Parser 2.31 Simple really, but so far it is impossible [ for me ] to get past step 1. I've taken out the __declspec(dllexport) from the source code so I can use the .DEF instead, and guess that the .DEF file gets put into the library to allow access to functions by ordinals [dynamic] rather than entry point addresses [static] I can generate a stock standard .xs file using h2xs against Expat.h, then running make.. I think I need to customize the Makefile.pl here LIBS,PREREQ_PM etc. It always complains about not finding the library, so as yet I cant perform make install I assume the .xs file gets compiled into the into the library to act as a bridge between perl and the c functions and when I call my perl subs they talk to the interface this xsub adds to the lib. Is there already a .DEF and .XS (even an earlier version) that I can use? Is this the forum for this message? Can anyone share any insight? In the mean time I'm using XML::SAX::Pureperl .. because my boss isn't so eager as me =o) Please advise, thanks in advance Regards, Warren Crossing > -----Original Message----- > From: Fred L. Drake, Jr. [SMTP:fdrake@acm.org] > Sent: Tuesday, October 08, 2002 9:59 PM > To: Karl Waclawek > Cc: Warren Crossing; expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Rebuilding Expat for ActivePerl > > > Karl Waclawek writes: > > AFAIK, applications working with 1_95_2 should still work with 1_95_5. > > Don't know about 1_95_1. > > This may not be binary compatible, though -- a relink is needed on > Windows since we don't control how the link table for Expat is built. > That means DLLs for different versions of Expat are not "drop in" > compatible. > > SourceForge bug #579144 describes this in slightly more detail: > > http://sourceforge.net/tracker/index.php?func=detail&aid=579144&group_id=1 > 0127&atid=110127 > > > -Fred > > -- > Fred L. Drake, Jr. > PythonLabs at Zope Corporation > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman-21/listinfo/expat-discuss > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This message is intended only for the addressee and may contain information that is confidential or privileged. Unauthorised use is strictly prohibited and may be unlawful. If you are not the addressee, you should not read, copy, disclose or otherwise use this message, except for the purpose of delivery to the addressee. If you have received this in error, please delete and advise us immediately. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Although Company Watch makes every reasonable effort to keep its network and systems free from viruses, the company accepts no responsibility for computer viruses transmitted through this mail or in any attachments. It is your responsibility to virus scan any attachments we send to you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From Josh.Martin@abq.sc.philips.com Wed Oct 9 23:35:57 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Wed, 9 Oct 2002 16:35:57 -0600 (MDT) Subject: [Expat-discuss] expact, make check, no check.h Message-ID: <200210092235.g99MZwp17840@atoae450.abq.sc.philips.com> > > > > Robert, I have already built, installed, and tested (by hand) a 64-bit > > version of expat-1.95.5, so this doesn't need to be done again. > > > > We have an open 64bit related bug, but can't reproduce it: > Bug #491986 Charset decoding error (64-bit systems). > > Since you seem to have a 64bit Expat at hand, and you > likely have run the related (regression) tests (see above), > am I right to assume that you had no error? > > Thanks, > > Karl I just installed Check and ran the tests for expat. All of the tests passed. My build/host string is hppa64-hp-hpux11.00. - Josh Martin From Josh.Martin@abq.sc.philips.com Wed Oct 9 23:46:23 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Wed, 9 Oct 2002 16:46:23 -0600 (MDT) Subject: [Expat-discuss] Rebuilding Expat for ActivePerl Message-ID: <200210092246.g99MkOp20904@atoae450.abq.sc.philips.com> > >From my understanding of the current sitch, theres not a lot of clear doco.. > but I think... In order to upgrade the parser 2.31 to work with later builds > of Expat on win32.. > > 1. I need to compile Expat_1_95_2 source files into dynamic link library > (.dll) using a .DEF file > > Please advise, thanks in advance > > Regards, > Warren Crossing Warren, If I remember correctly there is some added functionality to the configuration files for expat-1.95.5 for building windows DLL files, so you may want to try that instead of using expat-1.95.2. - Josh Martin From firas@apexion.com Thu Oct 17 10:46:36 2002 From: firas@apexion.com (Firas Abughazaleh) Date: Thu, 17 Oct 2002 12:46:36 +0300 Subject: [Expat-discuss] Exiting expat handlers Message-ID: <00d601c275c2$164d5ff0$b60000c0@menhajd.com> This is a multi-part message in MIME format. ---------------------- multipart/alternative attachment Hi all, Anyone knows how can you exit an instance of expat gracefully if you = were inside an element handler and you encountered an error inside it? Thanks, - Firas ---------------------- multipart/alternative attachment-- From wcrossing@companywatch.net Thu Oct 17 11:00:27 2002 From: wcrossing@companywatch.net (Warren Crossing) Date: Thu, 17 Oct 2002 11:00:27 +0100 Subject: [Expat-discuss] Exiting expat handlers Message-ID: <77BBB49BC061D211814E00A0C9EA23E32FD5E8@COMPANYWATCH> The first parameter of the callback sub is a reference to the parser!? When you encounter an application specific error can you call release() and/or finish() ? are you using lib expat for perl or c? regards warren? > -----Original Message----- > From: Firas Abughazaleh [SMTP:firas@apexion.com] > Sent: Thursday, October 17, 2002 10:47 AM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] Exiting expat handlers > > Hi all, > > Anyone knows how can you exit an instance of expat gracefully if you were > inside an element handler and you encountered an error inside it? > > Thanks, > - Firas > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This message is intended only for the addressee and may contain information that is confidential or privileged. Unauthorised use is strictly prohibited and may be unlawful. If you are not the addressee, you should not read, copy, disclose or otherwise use this message, except for the purpose of delivery to the addressee. If you have received this in error, please delete and advise us immediately. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Although Company Watch makes every reasonable effort to keep its network and systems free from viruses, the company accepts no responsibility for computer viruses transmitted through this mail or in any attachments. It is your responsibility to virus scan any attachments we send to you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From firas@apexion.com Thu Oct 17 11:29:02 2002 From: firas@apexion.com (Firas Abughazaleh) Date: Thu, 17 Oct 2002 13:29:02 +0300 Subject: [Expat-discuss] Exiting expat handlers References: <77BBB49BC061D211814E00A0C9EA23E32FD5E8@COMPANYWATCH> Message-ID: <00e801c275c8$03ab9280$b60000c0@menhajd.com> This is a multi-part message in MIME format. ---------------------- multipart/alternative attachment Hi Warren, I see your point here. I just found out that i can use: void XMLPARSEAPI = XML_UseParserAsHandlerArg(XML_Parser parser); expat API. Or simply pass = my parser instance as a parameter to the userdata member of callbacks. I = am using the C library of expat. Now, if an error occurs, i can just call = XML_FreeParser(myparserinstance); safely inside my handler procedure? I = am using a C++ wrapper class for the C expat APIs. Thanks, - Firas ----- Original Message -----=20 From: "Warren Crossing" To: "Firas Abughazaleh" ; = Sent: Thursday, October 17, 2002 1:00 PM Subject: RE: [Expat-discuss] Exiting expat handlers > The first parameter of the callback sub is a reference to the parser!? > When you encounter an application specific error can you call = release() > and/or finish() ? > are you using lib expat for perl or c? >=20 > regards >=20 > warren? >=20 > > -----Original Message----- > > From: Firas Abughazaleh [SMTP:firas@apexion.com] > > Sent: Thursday, October 17, 2002 10:47 AM > > To: expat-discuss@libexpat.org > > Subject: [Expat-discuss] Exiting expat handlers > >=20 > > Hi all, > >=20 > > Anyone knows how can you exit an instance of expat gracefully if you = were > > inside an element handler and you encountered an error inside it? > >=20 > > Thanks, > > - Firas > >=20 > >=20 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > This message is intended only for the addressee and may=20 > contain information that is confidential or privileged.=20 > Unauthorised use is strictly prohibited and may be unlawful. >=20 > If you are not the addressee, you should not read, copy,=20 > disclose or otherwise use this message, except for the > purpose of delivery to the addressee. If you have received > this in error, please delete and advise us immediately. >=20 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Although Company Watch makes every reasonable effort to keep > its network and systems free from viruses, the company > accepts no responsibility for computer viruses transmitted > through this mail or in any attachments. It is your > responsibility to virus scan any attachments we send to you. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 >=20 > ---------------------- multipart/alternative attachment-- From ee@opera.com Thu Oct 17 12:24:33 2002 From: ee@opera.com (erik eriksson) Date: 17 Oct 2002 13:24:33 +0200 Subject: [Expat-discuss] Expat 1.2 bug? Message-ID: <87fzv5e2a6.fsf@tank.palace.opera.no> ---------------------- multipart/mixed attachment Hi, This test program with attached xml-file crashes Expat 1.2. Is this a known bug? Is there any patch available? Reading same file with expat 1.95.2 (installed on my Debian system) works fine. (attachments also available as http://people.opera.com/~ee/xml/crash.c and http://people.opera.com/~ee/xml/crash.xml) / erik ---------------------- multipart/mixed attachment #include #include "expat/xmlparse/xmlparse.h" char* filename = "crash.xml"; int main() { XML_Parser xml_parser = XML_ParserCreate("utf-16"); FILE* f = fopen(filename, "r"); size_t bufsize = 32; char buf[bufsize]; size_t s = fread(buf, 1, bufsize, f); while (s > 0) { int result = XML_Parse(xml_parser, buf, s, 0); s = fread(buf, 1, bufsize, f); } XML_ParserFree(xml_parser); } ---------------------- multipart/mixed attachment A non-text attachment was scrubbed... Name: crash.xml Type: text/xml Size: 12 bytes Desc: crashes expat Url : http://mail.libexpat.org/pipermail-21/expat-discuss/attachments/20021017/bb20b19f/crash.xml ---------------------- multipart/mixed attachment -- ee@opera.com +4613203202(work) +46705228912(cell) +4613102599(home) ---------------------- multipart/mixed attachment-- From ee@opera.com Thu Oct 17 13:35:29 2002 From: ee@opera.com (erik eriksson) Date: 17 Oct 2002 14:35:29 +0200 Subject: [Expat-discuss] Re: Expat 1.2 bug? References: <87fzv5e2a6.fsf@tank.palace.opera.no> Message-ID: <877kghkzu6.fsf@tank.palace.opera.no> >>>>> "erik" == erik eriksson writes: erik> Hi, This test program with attached xml-file crashes Expat erik> 1.2. Is this a known bug? Is there any patch available? erik> Reading same file with expat 1.95.2 (installed on my Debian erik> system) works fine. stack trace: 00000000() normal_scanPi(...) normal_prologTok(...) doProlog(...) prologProcessor(...) prologInitProcessor(...) XML_Parse(...) -- ee@opera.com +4613203202(work) +46705228912(cell) +4613102599(home) From karl@waclawek.net Thu Oct 17 14:02:36 2002 From: karl@waclawek.net (Karl Waclawek) Date: Thu, 17 Oct 2002 09:02:36 -0400 Subject: [Expat-discuss] Exiting expat handlers References: <77BBB49BC061D211814E00A0C9EA23E32FD5E8@COMPANYWATCH> <00e801c275c8$03ab9280$b60000c0@menhajd.com> Message-ID: <003501c275dd$774e5640$9e539696@citkwaclaww2k> > Hi Warren, > I see your point here. I just found out that i can use: > void XMLPARSEAPI XML_UseParserAsHandlerArg(XML_Parser parser); expat API. > Or simply pass my parser instance as a parameter to the userdata member of callbacks. > I am using the C library of expat. > Now, if an error occurs, i can just call XML_FreeParser(myparserinstance); safely > inside my handler procedure? I am using a C++ wrapper class for the C expat APIs. No you should not do that, because after returning from the handler there is still some code being executed in the parser. You need to set a flag and then free the parser on return from the parse function. However, since you are using C++, you can throw an exception in the handler, triggering an immediate return from the parse function, and then - in the exception handling code - you free the parser. Karl From karl@waclawek.net Thu Oct 17 14:10:36 2002 From: karl@waclawek.net (Karl Waclawek) Date: Thu, 17 Oct 2002 09:10:36 -0400 Subject: [Expat-discuss] Expat 1.2 bug? References: <87fzv5e2a6.fsf@tank.palace.opera.no> Message-ID: <00ca01c275de$9563f260$9e539696@citkwaclaww2k> > This test program with attached xml-file crashes Expat 1.2. Is this a > known bug? Is there any patch available? Yes, the patch for an older version of Expat is a newer one. ;-) > Reading same file with expat > 1.95.2 (installed on my Debian system) works fine. Well, I guess there is your patch. Btw, 1.95.5 tells me that the encoding is incorrect, which seems to be the right behaviour. > > (attachments also available as http://people.opera.com/~ee/xml/crash.c > and http://people.opera.com/~ee/xml/crash.xml) Karl From Josh.Martin@abq.sc.philips.com Thu Oct 17 18:39:10 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Thu, 17 Oct 2002 11:39:10 -0600 (MDT) Subject: [Expat-discuss] Exiting expat handlers Message-ID: <200210171739.g9HHdBp14731@atoae450.abq.sc.philips.com> > From: "Firas Abughazaleh" > Date: Thu, 17 Oct 2002 12:46:36 +0300 > Hi all, > > Anyone knows how can you exit an instance of expat gracefully if you were inside an element handler and you encountered an error inside it? > > Thanks, > - Firas Firas, Do you mean a) exiting the handler, b) terminating parsing and killing the parser (object), or c) terminating the program? - Josh Martin From firas@apexion.com Sun Oct 20 07:53:34 2002 From: firas@apexion.com (Firas Abughazaleh) Date: Sun, 20 Oct 2002 09:53:34 +0300 Subject: [Expat-discuss] Exiting expat handlers References: <200210171739.g9HHdBp14731@atoae450.abq.sc.philips.com> Message-ID: <000b01c27805$6c148950$b60000c0@menhajd.com> Excatly Josh. That is the thing i am aiming to accomplish. Thanks. ----- Original Message ----- From: "Josh Martin" To: ; Sent: Thursday, October 17, 2002 8:39 PM Subject: Re: [Expat-discuss] Exiting expat handlers > > From: "Firas Abughazaleh" > > Date: Thu, 17 Oct 2002 12:46:36 +0300 > > Hi all, > > > > Anyone knows how can you exit an instance of expat gracefully if you were > inside an element handler and you encountered an error inside it? > > > > Thanks, > > - Firas > > Firas, > > Do you mean a) exiting the handler, b) terminating parsing and killing the > parser (object), or c) terminating the program? > > - Josh Martin > > From jcholiz@tango04.net Wed Oct 23 09:37:25 2002 From: jcholiz@tango04.net (=?iso-8859-1?Q?Jes=FAs_Ch=F3liz?=) Date: Wed, 23 Oct 2002 10:37:25 +0200 Subject: [Expat-discuss] How to parse a string instead of a file Message-ID: Hi all, Maybe it's a stupid question, but do you know to parse a string instead of passing a file to Expat parser? In addition, do you know where I can find an API documentation of Expat internal functions? Thanks in advance, J.Choliz From karl@waclawek.net Wed Oct 23 14:07:02 2002 From: karl@waclawek.net (Karl Waclawek) Date: Wed, 23 Oct 2002 09:07:02 -0400 Subject: [Expat-discuss] How to parse a string instead of a file References: Message-ID: <002c01c27a95$13e70c20$9e539696@citkwaclaww2k> > Hi all, > > Maybe it's a stupid question, but do you know to parse a string instead of > passing a file to Expat parser? Pass the string as the buffer to XML_ParseBuffer. > In addition, do you know where I can find an API documentation of Expat > internal functions? We have recently started to add more comments to the source code, but basically, the only approach I can recommend is reading the source. James Clark wrote it at a very high level of sophistication, but at this level it is clearly structured and there are no surprises. Still, it isn't for the faint of heart. Karl From sidney.richards@xs4all.nl Wed Oct 23 17:33:02 2002 From: sidney.richards@xs4all.nl (Sidney Richards) Date: Wed, 23 Oct 2002 18:33:02 +0200 Subject: [Expat-discuss] Beginner's question Message-ID: <002b01c27ab1$db42e6b0$9700000a@sidcomp> This is a multi-part message in MIME format. ---------------------- multipart/alternative attachment Hey all, Ran into a small problem earlier on. While trying to parse a chunk of = XML, read into a char* using fread from a textfile, I get a parse error: Not well-formed (invalid token) Here's the function call: if (XML_Parse(parser, xml_buffer, strlen(xml_buffer),true) =3D=3D = XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); } The thing is, it parses the entire document fine, but the problem seems = to lie in the strlen(xml_buffer) call, because if I use if (XML_Parse(parser, xml_buffer, strlen(xml_buffer)-4,true) =3D=3D=20 the error disappears. There doesn't seem to be any junk characters in = the file (and it gets parsed without a problem if I open the xml file in = IE). Anyone know what might be causing this? Cheers, Sid ---------------------- multipart/alternative attachment-- From karl@waclawek.net Wed Oct 23 21:00:47 2002 From: karl@waclawek.net (Karl Waclawek) Date: Wed, 23 Oct 2002 16:00:47 -0400 Subject: [Expat-discuss] Beginner's question References: <002b01c27ab1$db42e6b0$9700000a@sidcomp> Message-ID: <001a01c27ace$e0ca2130$9e539696@citkwaclaww2k> How big is the buffer? Do you re-allocate the buffer with the return value from fread? If yes, there may not be a null terminator in the buffer, otherwise strlen might include junk at the end of the buffer in its computation. Just use the return value from fread as the length argument for XML_Parse. Karl ----- Original Message ----- From: "Sidney Richards" To: Sent: Wednesday, October 23, 2002 12:33 PM Subject: [Expat-discuss] Beginner's question Hey all, Ran into a small problem earlier on. While trying to parse a chunk of XML, read into a char* using fread from a textfile, I get a parse error: Not well-formed (invalid token) Here's the function call: if (XML_Parse(parser, xml_buffer, strlen(xml_buffer),true) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); } The thing is, it parses the entire document fine, but the problem seems to lie in the strlen(xml_buffer) call, because if I use if (XML_Parse(parser, xml_buffer, strlen(xml_buffer)-4,true) == the error disappears. There doesn't seem to be any junk characters in the file (and it gets parsed without a problem if I open the xml file in IE). Anyone know what might be causing this? Cheers, Sid From sidney.richards@xs4all.nl Wed Oct 23 23:28:44 2002 From: sidney.richards@xs4all.nl (Sidney Richards) Date: Thu, 24 Oct 2002 00:28:44 +0200 Subject: [Expat-discuss] Beginner's question References: <002b01c27ab1$db42e6b0$9700000a@sidcomp> <001a01c27ace$e0ca2130$9e539696@citkwaclaww2k> Message-ID: <004c01c27ae3$92215ca0$9700000a@sidcomp> Thanks a lot, using the fread's return value did the trick. :) Cheers, Sid ----- Original Message ----- From: "Karl Waclawek" To: "Sidney Richards" ; Sent: Wednesday, October 23, 2002 10:00 PM Subject: Re: [Expat-discuss] Beginner's question > How big is the buffer? > Do you re-allocate the buffer with the return value from fread? > If yes, there may not be a null terminator in the buffer, > otherwise strlen might include junk at the end of the buffer in its computation. > Just use the return value from fread as the length argument for XML_Parse. > > Karl > > ----- Original Message ----- > From: "Sidney Richards" > To: > Sent: Wednesday, October 23, 2002 12:33 PM > Subject: [Expat-discuss] Beginner's question > > > Hey all, > > Ran into a small problem earlier on. While trying to parse a chunk of XML, read into a char* using > fread from a textfile, I get a parse error: > > Not well-formed (invalid token) > > Here's the function call: > if (XML_Parse(parser, xml_buffer, strlen(xml_buffer),true) == XML_STATUS_ERROR) { > fprintf(stderr, "Parse error at line %d:\n%s\n", > XML_GetCurrentLineNumber(parser), > XML_ErrorString(XML_GetErrorCode(parser))); > } > > The thing is, it parses the entire document fine, but the problem seems to lie in the > strlen(xml_buffer) call, because if I use > > if (XML_Parse(parser, xml_buffer, strlen(xml_buffer)-4,true) == > > the error disappears. There doesn't seem to be any junk characters in the file (and it gets parsed > without a problem if I open the xml file in IE). > > Anyone know what might be causing this? > > Cheers, > > Sid > > From Josh.Martin@abq.sc.philips.com Fri Oct 25 00:54:54 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Thu, 24 Oct 2002 17:54:54 -0600 (MDT) Subject: [Expat-discuss] Exiting expat handlers Message-ID: <200210242354.g9ONstp23257@atoae450.abq.sc.philips.com> Erm, that was not a yes or no question. Which one are you trying to do: a), b), or c)? - Josh > From: "Firas Abughazaleh" > Date: Sun, 20 Oct 2002 09:53:34 +0300 > > Excatly Josh. That is the thing i am aiming to accomplish. > Thanks. > > ----- Original Message ----- > From: "Josh Martin" > To: ; > Sent: Thursday, October 17, 2002 8:39 PM > Subject: Re: [Expat-discuss] Exiting expat handlers > > > > > From: "Firas Abughazaleh" > > > Date: Thu, 17 Oct 2002 12:46:36 +0300 > > > Hi all, > > > > > > Anyone knows how can you exit an instance of expat gracefully if you > were > > inside an element handler and you encountered an error inside it? > > > > > > Thanks, > > > - Firas > > > > Firas, > > > > Do you mean a) exiting the handler, b) terminating parsing and killing the > > parser (object), or c) terminating the program? > > > > - Josh Martin > > > > > > > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman-21/listinfo/expat-discuss From boby_jose@yahoo.com Fri Oct 25 05:25:40 2002 From: boby_jose@yahoo.com (boby jose) Date: Thu, 24 Oct 2002 21:25:40 -0700 (PDT) Subject: [Expat-discuss] New user Message-ID: <20021025042540.20132.qmail@web10802.mail.yahoo.com> HI all, How can I do DTD validation on my XML file?? thanks, Boby Jose __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ From fdrake@acm.org Fri Oct 25 13:55:57 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 25 Oct 2002 08:55:57 -0400 Subject: [Expat-discuss] New user In-Reply-To: <20021025042540.20132.qmail@web10802.mail.yahoo.com> References: <20021025042540.20132.qmail@web10802.mail.yahoo.com> Message-ID: <15801.16221.248909.327149@grendel.zope.com> boby jose writes: > How can I do DTD validation on my XML file?? Expat is not a validating parser. While it can read the DTD information, including external subsets, no validation is performed. We do not intend to add this feature. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From pdennett@padsoft.com Fri Oct 25 15:05:15 2002 From: pdennett@padsoft.com (Peter Dennett) Date: Fri, 25 Oct 2002 09:05:15 -0500 Subject: [Expat-discuss] expat Thread safe? Message-ID: <01bd01c27c2f$8af0f6f0$5e01a8c0@RAD> I would like to run expat on several different threads at the same time. Any one know of any problems within expat with statics, globals, or externals? I certainly will be looking at the code but hope someone may have already faced this... Peter Dennett Email: pdennett@padsoft.com 61 Harbor Lane Web: www.padsoft.com Kemah, TX 77565 Web: www.boatbrains.com Voice: 281 334 3800 Cell: 713 899 6100 From fdrake@acm.org Fri Oct 25 15:43:16 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 25 Oct 2002 10:43:16 -0400 Subject: [Expat-discuss] expat Thread safe? In-Reply-To: <01bd01c27c2f$8af0f6f0$5e01a8c0@RAD> References: <01bd01c27c2f$8af0f6f0$5e01a8c0@RAD> Message-ID: <15801.22660.149122.422378@grendel.zope.com> Peter Dennett writes: > I would like to run expat on several different threads > at the same time. Any one know of any problems > within expat with statics, globals, or externals? > I certainly will be looking at the code but hope > someone may have already faced this... At any given time, only one thread should be using any single XML_Parser object, but several threads can use separate XML_Parser objects without problems. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From Josh.Martin@abq.sc.philips.com Fri Oct 25 18:36:16 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Fri, 25 Oct 2002 11:36:16 -0600 (MDT) Subject: [Expat-discuss] New user Message-ID: <200210251736.g9PHaHp13305@atoae450.abq.sc.philips.com> > Date: Fri, 25 Oct 2002 08:55:57 -0400 > From: "Fred L. Drake, Jr." > boby jose writes: > > How can I do DTD validation on my XML file?? > > Expat is not a validating parser. While it can read the DTD > information, including external subsets, no validation is performed. > > We do not intend to add this feature. > > > -Fred You will most likely have to resort to a commercial XML program for validation. I do know that you can get a trial copy of the very fully featured XML IDE called XML Spy. Whether you're just trying to learn more about XML, or you're looking for a validator to use for your business a free trial is not a bad place to start. Due to issues which are unimportant here I never got to try it, so I don't know if the trial is just timed, or if it's crippled, but I was very impressed with what I read about XML Spy. Or let us know if you find another program that you like. - Josh Martin From Josh.Martin@abq.sc.philips.com Fri Oct 25 18:43:41 2002 From: Josh.Martin@abq.sc.philips.com (Josh Martin) Date: Fri, 25 Oct 2002 11:43:41 -0600 (MDT) Subject: [Expat-discuss] Open source success? Message-ID: <200210251743.g9PHhfp15402@atoae450.abq.sc.philips.com> I suppose this question is mostly directed at Fred, but that answer should be insteresting to the group. While looking at the ending credits for a couple of my games the other day I noticed that, along with zlib and the jpeg lib, Expat was listed in the credits, or rather the "thanks", for both Warcraft III and Hitman 2. I was wondering if you had noticed this, and if you knew if it was this Expat, and if you know of any other commercial programs that have made use of it. - Josh Martin From abolgar@mail.natm.ru Fri Oct 25 19:25:51 2002 From: abolgar@mail.natm.ru (Artyom S. Bolgar) Date: Fri, 25 Oct 2002 22:25:51 +0400 Subject: [Expat-discuss] Open source success? References: <200210251743.g9PHhfp15402@atoae450.abq.sc.philips.com> Message-ID: <010e01c27c53$f33d8420$dededede@kitty> Objective Systems, Inc uses Expat in their ASN.1 compiler - http://www.obj-sys.com. We made C++ SAX wrapper for it and use it instead of Xerces for decoding XER messages (X.693). You may download the evaluation version of 5.4 beta and have a look onto it. And one more note: the Expat's decoding is significiantly faster than in Xerces and MSXML, sometimes in more than 4 times! And it is most compact library as well. I like it! :) Yours sincerely. Artyom Bolgar. From karl@waclawek.net Fri Oct 25 19:41:33 2002 From: karl@waclawek.net (Karl Waclawek) Date: Fri, 25 Oct 2002 14:41:33 -0400 Subject: [Expat-discuss] Open source success? References: <200210251743.g9PHhfp15402@atoae450.abq.sc.philips.com> <010e01c27c53$f33d8420$dededede@kitty> Message-ID: <00c701c27c56$243c04a0$9e539696@citkwaclaww2k> > Objective Systems, Inc uses Expat in their ASN.1 compiler - > http://www.obj-sys.com. We made C++ SAX wrapper for it and use it instead of > Xerces for decoding XER messages (X.693). You may download the evaluation > version of 5.4 beta and have a look onto it. > And one more note: the Expat's decoding is significiantly faster than in > Xerces and MSXML, sometimes in more than 4 times! And it is most compact > library as well. I like it! :) Which version of Expat are you using? Karl From abolgar@mail.natm.ru Fri Oct 25 20:54:07 2002 From: abolgar@mail.natm.ru (Artyom S. Bolgar) Date: Fri, 25 Oct 2002 23:54:07 +0400 Subject: [Expat-discuss] Open source success? References: <200210251743.g9PHhfp15402@atoae450.abq.sc.philips.com><010e01c27c53$f33d8420$dededede@kitty> <00c701c27c56$243c04a0$9e539696@citkwaclaww2k> Message-ID: <012301c27c60$5effeb10$dededede@kitty> From: "Karl Waclawek" > > Which version of Expat are you using? > The latest, 1.95.5, of course. Yours sincerely. Artyom Bolgar. From firas@apexion.com Sun Oct 27 07:53:04 2002 From: firas@apexion.com (Firas Abughazaleh) Date: Sun, 27 Oct 2002 10:53:04 +0300 Subject: [Expat-discuss] Exiting expat handlers References: <200210242354.g9ONstp23257@atoae450.abq.sc.philips.com> Message-ID: <000701c27d8d$e21ac0a0$b60000c0@menhajd.com> Hi Josh, What i meant here is that: Yes, all the points are applicable to my case. May be i did not clear my answer enough, my mistake, sorry! Thanks, - Firas ----- Original Message ----- From: "Josh Martin" To: ; ; Sent: Friday, October 25, 2002 2:54 AM Subject: Re: [Expat-discuss] Exiting expat handlers > Erm, that was not a yes or no question. Which one are you trying to do: > a), b), or c)? > > - Josh > > > From: "Firas Abughazaleh" > > Date: Sun, 20 Oct 2002 09:53:34 +0300 > > > > Excatly Josh. That is the thing i am aiming to accomplish. > > Thanks. > > > > ----- Original Message ----- > > From: "Josh Martin" > > To: ; > > Sent: Thursday, October 17, 2002 8:39 PM > > Subject: Re: [Expat-discuss] Exiting expat handlers > > > > > > > > From: "Firas Abughazaleh" > > > > Date: Thu, 17 Oct 2002 12:46:36 +0300 > > > > Hi all, > > > > > > > > Anyone knows how can you exit an instance of expat gracefully if you > > were > > > inside an element handler and you encountered an error inside it? > > > > > > > > Thanks, > > > > - Firas > > > > > > Firas, > > > > > > Do you mean a) exiting the handler, b) terminating parsing and killing > the > > > parser (object), or c) terminating the program? > > > > > > - Josh Martin > > > > > > > > > > > > > > _______________________________________________ > > Expat-discuss mailing list > > Expat-discuss@libexpat.org > > http://mail.libexpat.org/mailman-21/listinfo/expat-discuss > > From gb2111@poczta.onet.pl Mon Oct 28 08:10:44 2002 From: gb2111@poczta.onet.pl (gb2111@poczta.onet.pl) Date: Mon, 28 Oct 2002 9:10:44 +0100 Subject: [Expat-discuss] iso-8859-2? Message-ID: Can anybody tell me what to do to be able to parse file with this encoding? regards, gb From cepek@gama.fsv.cvut.cz Mon Oct 28 17:24:49 2002 From: cepek@gama.fsv.cvut.cz (Ales Cepek) Date: 28 Oct 2002 18:24:49 +0100 Subject: [Expat-discuss] Re: iso-8859-2? References: Message-ID: <877kg2zdb2.fsf@GaMa.fsv.cvut.cz> gb2111@poczta.onet.pl writes: > Can anybody tell me what to do > to be able to parse file with this encoding? ... you can try encoding.[h|cpp] from http://www.gnu.org/software/gama Hope it will help. Ales Cepek From klj@donnell.com Mon Oct 28 21:10:24 2002 From: klj@donnell.com (Ken Johnston) Date: Mon, 28 Oct 2002 16:10:24 -0500 Subject: [Expat-discuss] Exiting expat handlers Message-ID: <003b01c27ec6$6e6d81d0$1ec909c0@dev.donnell.com> Josh, I would be very interested in finding out about option b). Is there any way in ANSI C (not C++) for a handler which detects an application error to cause XML_Parse to abort parsing and return immediately to the caller (of XML_Parse)? It doesn't have to return with an error or clean up the parse object. That could all be flagged in the user data from the handler that found the error. Thanks, - Ken Johnston >> From: "Firas Abughazaleh" >> Date: Thu, 17 Oct 2002 12:46:36 +0300 >> Hi all, >> >> Anyone knows how can you exit an instance of expat gracefully if you were >inside an element handler and you encountered an error inside it? >> >> Thanks, >> - Firas > >Firas, > >Do you mean a) exiting the handler, b) terminating parsing and killing the >parser (object), or c) terminating the program? > > - Josh Martin From abolgar@mail.natm.ru Mon Oct 28 21:42:24 2002 From: abolgar@mail.natm.ru (Artyom S. Bolgar) Date: Tue, 29 Oct 2002 00:42:24 +0300 Subject: [Expat-discuss] Exiting expat handlers References: <003b01c27ec6$6e6d81d0$1ec909c0@dev.donnell.com> Message-ID: <00f601c27eca$e7db55c0$dededede@kitty> I use the setjmp/longjmp for these purposes. Something like that: === jmp_buf mark; // global, or accessible from handlers ....... XML_Parser pparser = XML_ParserCreate (NULL); XML_SetUserData(pparser, &valueS); XML_SetElementHandler(pparser, ........); XML_SetCharacterDataHandler(pparser, .........); jmpret = setjmp(mark); if (jmpret == 0) { // not error if (XML_Parse (pparser, ASN1BUFPTR(pctxt), pctxt->buffer.size, TRUE) == 0) { // is error occured? // parser's error handling here } } else { //error! i.e. longjmp invoked ... do something or nothing ..... } XML_ParserFree (pparser); === Inside the handlers to raise an "exception" call longjmp: longjmp(mark, stat); // stat is error code, any integers Yours sincerely. Artyom Bolgar. Objective Systems, Inc. http://www.obj-sys.com ----- Original Message ----- From: "Ken Johnston" To: Sent: Tuesday, October 29, 2002 12:10 AM Subject: [Expat-discuss] Exiting expat handlers > Josh, > > I would be very interested in finding out about option b). Is there any > way in ANSI C (not C++) for a handler which detects an application error > to cause XML_Parse to abort parsing and return immediately to the caller > (of XML_Parse)? It doesn't have to return with an error or clean up the > parse object. That could all be flagged in the user data from the > handler that found the error. > > Thanks, > - Ken Johnston > > >> From: "Firas Abughazaleh" > >> Date: Thu, 17 Oct 2002 12:46:36 +0300 > >> Hi all, > >> > >> Anyone knows how can you exit an instance of expat gracefully if you > were > >inside an element handler and you encountered an error inside it? > >> > >> Thanks, > >> - Firas > > > >Firas, > > > >Do you mean a) exiting the handler, b) terminating parsing and killing > the > >parser (object), or c) terminating the program? > > > > - Josh Martin > > > > > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman-21/listinfo/expat-discuss > From fdrake@acm.org Mon Oct 28 22:18:36 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 28 Oct 2002 17:18:36 -0500 Subject: [Expat-discuss] Exiting expat handlers In-Reply-To: <003b01c27ec6$6e6d81d0$1ec909c0@dev.donnell.com> References: <003b01c27ec6$6e6d81d0$1ec909c0@dev.donnell.com> Message-ID: <15805.47036.198380.722791@grendel.zope.com> Ken Johnston writes: > I would be very interested in finding out about option b). Is there any > way in ANSI C (not C++) for a handler which detects an application error > to cause XML_Parse to abort parsing and return immediately to the caller > (of XML_Parse)? It doesn't have to return with an error or clean up the > parse object. That could all be flagged in the user data from the > handler that found the error. I'm afraid the support for this isn't very good in the current API. What I do for the Python bindings is, if an exception is raised by Python, remove all the callbacks (which avoids some overhead, but not the actual parsing), and installs a special handler for the external entity reference handler that simply reports that an error has occurred (CVS version of PyXML only, for any Python users out there). The setjmp/longjmp approach, described by someone else on the list, can certainly work, but can cause problems for long-running processes that keep lots of objects on the heap but maintain lifetime information on the stack, so you need to be careful with that approach. We are planning to improve this situation in a future release, but haven't had time to work on it recently. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From klj@donnell.com Tue Oct 29 14:24:04 2002 From: klj@donnell.com (Ken Johnston) Date: Tue, 29 Oct 2002 09:24:04 -0500 Subject: [Expat-discuss] Exiting expat handlers In-Reply-To: <15805.47036.198380.722791@grendel.zope.com> Message-ID: <000301c27f56$d5903cf0$1ec909c0@dev.donnell.com> Thanks for the feedback. The setjmp/longjmp solution won't work for me since this application is a long running multi-threaded server and the setjmp/longjmp functions are not thread safe (at least not on Solaris). Looks like the best answer for now is to flag the error, set null handlers, and keep checking for future Expat releases. Thanks again, - Ken Johnston > -----Original Message----- > From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] > Sent: Monday, October 28, 2002 5:19 PM > To: klj@donnell.com > Cc: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Exiting expat handlers > > > Ken Johnston writes: > > I would be very interested in finding out about option b). Is there any > > way in ANSI C (not C++) for a handler which detects an application > error > > to cause XML_Parse to abort parsing and return immediately to the > caller > > (of XML_Parse)? It doesn't have to return with an error or clean up the > > parse object. That could all be flagged in the user data from the > > handler that found the error. > > I'm afraid the support for this isn't very good in the current API. > What I do for the Python bindings is, if an exception is raised by > Python, remove all the callbacks (which avoids some overhead, but not > the actual parsing), and installs a special handler for the external > entity reference handler that simply reports that an error has > occurred (CVS version of PyXML only, for any Python users out there). > > The setjmp/longjmp approach, described by someone else on the list, > can certainly work, but can cause problems for long-running processes > that keep lots of objects on the heap but maintain lifetime > information on the stack, so you need to be careful with that > approach. > > We are planning to improve this situation in a future release, but > haven't had time to work on it recently. > > > -Fred > > -- > Fred L. Drake, Jr. > PythonLabs at Zope Corporation From karl@waclawek.net Tue Oct 29 14:39:14 2002 From: karl@waclawek.net (Karl Waclawek) Date: Tue, 29 Oct 2002 09:39:14 -0500 Subject: [Expat-discuss] Exiting expat handlers References: <000301c27f56$d5903cf0$1ec909c0@dev.donnell.com> Message-ID: <000901c27f58$f4c620b0$9e539696@citkwaclaww2k> > Thanks for the feedback. The setjmp/longjmp solution won't work for me > since this application is a long running multi-threaded server and the > setjmp/longjmp functions are not thread safe (at least not on Solaris). > Looks like the best answer for now is to flag the error, set null > handlers, and keep checking for future Expat releases. Do they need to be if a pair of corresponding setjmp/longjmp functions is used in the same thread? Karl From klj@donnell.com Tue Oct 29 15:17:49 2002 From: klj@donnell.com (Ken Johnston) Date: Tue, 29 Oct 2002 10:17:49 -0500 Subject: [Expat-discuss] Exiting expat handlers In-Reply-To: <000901c27f58$f4c620b0$9e539696@citkwaclaww2k> Message-ID: <000b01c27f5e$57b617c0$1ec909c0@dev.donnell.com> I was relying on a section that Sun puts at the end of each man page. It rates the thread compatibility of each function. Sometimes they explain the reasons, sometimes they don't. In the case of setjmp/longjmp they are rated "Unsafe", which is the worst thread compatibility rating they have. Since different threads have different stacks it would seem possible to manage a multi-thread version of jumps. I suspect these functions were just implemented on Solaris with some global variables and never updated to a thread specific form. - Ken Johnston > -----Original Message----- > From: Karl Waclawek [mailto:karl@waclawek.net] > Sent: Tuesday, October 29, 2002 9:39 AM > To: klj@donnell.com > Cc: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Exiting expat handlers > > > Thanks for the feedback. The setjmp/longjmp solution won't work for me > > since this application is a long running multi-threaded server and the > > setjmp/longjmp functions are not thread safe (at least not on Solaris). > > Looks like the best answer for now is to flag the error, set null > > handlers, and keep checking for future Expat releases. > > Do they need to be if a pair of corresponding setjmp/longjmp > functions is used in the same thread? > > Karl From karl@waclawek.net Tue Oct 29 15:33:31 2002 From: karl@waclawek.net (Karl Waclawek) Date: Tue, 29 Oct 2002 10:33:31 -0500 Subject: [Expat-discuss] Exiting expat handlers References: <000b01c27f5e$57b617c0$1ec909c0@dev.donnell.com> Message-ID: <002801c27f60$8a3fa510$9e539696@citkwaclaww2k> > I was relying on a section that Sun puts at the end of each man page. It > rates the thread compatibility of each function. Sometimes they explain > the reasons, sometimes they don't. In the case of setjmp/longjmp they > are rated "Unsafe", which is the worst thread compatibility rating they > have. Since different threads have different stacks it would seem > possible to manage a multi-thread version of jumps. I suspect these > functions were just implemented on Solaris with some global variables > and never updated to a thread specific form. I am sorry to read that. ;-( We are planning to add return values to the Expat handlers, such that an application error will be passed back to Expat and the parser will then return immediately. Hopefully we will some time for implementation around the end of the year. But this will be part of Expat 3.0 - right now we are trying to finish off Expat 2.0. The current CVS is already quite close, I believe. Karl From dragonman@asiayeah.com Thu Oct 31 07:32:35 2002 From: dragonman@asiayeah.com (Tony Cheung) Date: Thu, 31 Oct 2002 15:32:35 +0800 Subject: [Expat-discuss] Expat on Palm Message-ID: <3DC0DC93.8020709@asiayeah.com> Hi, Have anyone tried to compile Expat on the PalmOS platform? Is it an easy job? I am interested in knowing its parsing performance, limitations and size on the Palm platform. Thank you. Tony Cheung From fdrake@acm.org Thu Oct 31 15:20:36 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Thu, 31 Oct 2002 10:20:36 -0500 Subject: [Expat-discuss] Expat on Palm In-Reply-To: <3DC0DC93.8020709@asiayeah.com> References: <3DC0DC93.8020709@asiayeah.com> Message-ID: <15809.19012.754302.397289@grendel.zope.com> Tony Cheung writes: > Have anyone tried to compile Expat on the PalmOS platform? > > Is it an easy job? I am interested in knowing its parsing performance, > limitations and size on the Palm platform. I don't recall hearing anything about a Palm port so far. If anyone has done one, I'd love to know about it, and can add a link to any public information about it from www.libexpat.org. I'd be especially interested in what changes were needed to Expat, if any, so that these can be integrated into future versions of Expat. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation