From John.Hockaday at ga.gov.au Tue Aug 3 04:00:20 2004 From: John.Hockaday at ga.gov.au (John.Hockaday@ga.gov.au) Date: Tue Aug 3 05:09:14 2004 Subject: [Expat-discuss] Am I on the right list? Message-ID: Hi Greg. Thanks for your reply. I just tried a ./configure --clean and received the message that "--clean" is an unrecognised option. Previously I did a "make distclean" but still had problems. I also resorted to completely deleting the src directories and unzip and untarred the expat-1.95.8.tar.gz file again to get rid of any previous configuration settings but I'm still having problems. Any other suggestions? Thanks. John > -----Original Message----- > From: Greg Martin [mailto:Greg.Martin@TELUS.COM] > Sent: Friday, 30 July 2004 2:20 AM > To: expat-discuss@libexpat.org > Subject: RE: [Expat-discuss] Am I on the right list? > > > You are on the right list. Did you "./configure --clean before doing > the second configure? Don't know if it would help or not. > > > -----Original Message----- > > From: expat-discuss-bounces@libexpat.org > > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of > > John.Hockaday@ga.gov.au > > Sent: Wednesday, July 28, 2004 7:56 PM > > To: expat-discuss@libexpat.org > > Subject: [Expat-discuss] Am I on the right list? > > > > > > Hi all, > > > > I sent out the email below to this list but no-one has > > replied. Am I on the > > right list? If not which list should I subscribe to? If I > > am on the right > > list is it just that no-one has a Solaris 8 system or does > > no-one understand > > my question? Should I re-phrase my email in some other way? > > Do I need to > > provide more information? > > > > > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > From Greg.Martin at TELUS.COM Tue Aug 3 16:26:18 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Tue Aug 3 16:25:59 2004 Subject: [Expat-discuss] Am I on the right list? Message-ID: > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of > John.Hockaday@ga.gov.au > Sent: Monday, August 02, 2004 8:00 PM > To: expat-discuss@libexpat.org > Subject: RE: [Expat-discuss] Am I on the right list? > > > Hi Greg. > > Thanks for your reply. I just tried a ./configure --clean > and received the > message that "--clean" is an unrecognised option. > > Previously I did a "make distclean" but still had problems. > I also resorted > to completely deleting the src directories and unzip and untarred the > expat-1.95.8.tar.gz file again to get rid of any previous > configuration > settings but I'm still having problems. > > Any other suggestions? > The last solaris build I did was 1.95.6 so I'll try *.8 and see what happens. I'll let you know. Greg. From Greg.Martin at TELUS.COM Tue Aug 3 17:02:38 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Tue Aug 3 17:01:50 2004 Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris 8platform Message-ID: > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of > John.Hockaday@ga.gov.au > Sent: Sunday, July 25, 2004 9:56 PM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris > 8platform > > > Hi, > > I am having troubles compiling Expat 1.95.8 on a Solaris 8 > platform using gcc > 3.4.1. If I configure with the following options: > > ./configure --prefix=/public/data/asddgate --enable-static > > And "make" there are no compilation errors but if I do a > "make check" I get > the following errors: > > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -DHAVE_EX > PAT_CONFIG_H -I./lib -I. -o tests/runtests.o -c tests/runtests.c > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -DHAVE_EX > PAT_CONFIG_H -I./lib -I. -o tests/chardata.o -c tests/chardata.c > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -DHAVE_EX > PAT_CONFIG_H -I./lib -I. -o tests/minicheck.o -c tests/minicheck.c > /bin/ksh ./libtool --silent --mode=link gcc -g -O2 -Wall > -Wmissing-prototypes > -W > strict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -I./lib -I. -o > tests/run > tests tests/runtests.o tests/chardata.o tests/minicheck.o libexpat.la > tests/runtests > Expat version: expat_1.95.4 > make: *** [check] Segmentation Fault (core dumped) > My install worked but I took a closer look at what you are doing. Note the expat version is not the same as what you are building. make install before doing a make check and you will likely get a different result. The prefix option is for the install directory. After you install if /public/data/asddgate is not in your lib path you'll have to add it (man crle). From John.Hockaday at ga.gov.au Wed Aug 4 01:46:38 2004 From: John.Hockaday at ga.gov.au (John.Hockaday@ga.gov.au) Date: Wed Aug 4 03:43:00 2004 Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris8platform Message-ID: Greg, You are absolutely right! If I do the configure, make, make install and *then* make check I get no errors! :--) :--) Thanks so much for your help. I'm sure the problem is caused by our organisation's policy of not loading software into /usr/local but your suggestion has got around the problem! Thanks again. :--) :--) (There aren't enough smiles to show how happy I am.) John > -----Original Message----- > From: Greg Martin [mailto:Greg.Martin@TELUS.COM] > Sent: Wednesday, 4 August 2004 1:03 AM > To: expat-discuss@libexpat.org > Subject: RE: [Expat-discuss] Problems compiling expat 1.95.8 > on Solaris8platform > > > > > > -----Original Message----- > > From: expat-discuss-bounces@libexpat.org > > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of > > John.Hockaday@ga.gov.au > > Sent: Sunday, July 25, 2004 9:56 PM > > To: expat-discuss@libexpat.org > > Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris > > 8platform > > > > > > Hi, > > > > I am having troubles compiling Expat 1.95.8 on a Solaris 8 > > platform using gcc > > 3.4.1. If I configure with the following options: > > > > ./configure --prefix=/public/data/asddgate --enable-static > > > > And "make" there are no compilation errors but if I do a > > "make check" I get > > the following errors: > > > > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes > -fexceptions > > -DHAVE_EX > > PAT_CONFIG_H -I./lib -I. -o tests/runtests.o -c tests/runtests.c > > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes > -fexceptions > > -DHAVE_EX > > PAT_CONFIG_H -I./lib -I. -o tests/chardata.o -c tests/chardata.c > > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes > -fexceptions > > -DHAVE_EX > > PAT_CONFIG_H -I./lib -I. -o tests/minicheck.o -c tests/minicheck.c > > /bin/ksh ./libtool --silent --mode=link gcc -g -O2 -Wall > > -Wmissing-prototypes > > -W > > strict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H > -I./lib -I. -o > > tests/run > > tests tests/runtests.o tests/chardata.o tests/minicheck.o > libexpat.la > > tests/runtests > > Expat version: expat_1.95.4 > > make: *** [check] Segmentation Fault (core dumped) > > > > My install worked but I took a closer look at what you are > doing. Note the > expat version is not the same as what you are building. make > install before > doing a make check and you will likely get a different > result. The prefix > option is for the install directory. After you install if > /public/data/asddgate > is not in your lib path you'll have to add it (man crle). > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss@libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > From fdrake at acm.org Wed Aug 4 05:13:51 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Aug 4 05:14:11 2004 Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris8platform In-Reply-To: References: Message-ID: <200408032313.51298.fdrake@acm.org> On Tuesday 03 August 2004 07:46 pm, John.Hockaday@ga.gov.au wrote: > Thanks so much for your help. I'm sure the problem is caused by our > organisation's policy of not loading software into /usr/local but your > suggestion has got around the problem! Actually, I think the problem is due to stupidity in the GNU libtool. Unfortunately, it's a tedious system, and the Expat contributor who set this up for us hasn't had time to take care of our use of this tool for a while. (Though he has started the second of two really cool jobs he's had since he first implemented this for us.) -Fred -- Fred L. Drake, Jr. From John.Hockaday at ga.gov.au Wed Aug 4 05:49:41 2004 From: John.Hockaday at ga.gov.au (John.Hockaday@ga.gov.au) Date: Wed Aug 4 08:34:10 2004 Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris8platform Message-ID: Thanks Fred, That makes me feel a bit better but I've had similar troubles with libxml2, yaz, OpenJade and Zap so I still believe not following the standard install path of /usr/local/ has something to do with it. Especially when each bit of software relies on linking to the previously one. Anyway, many thanks to this list's subscribers for all your help. It reinforces my belief that open source is better supported than proprietary software. Thanks. John > -----Original Message----- > From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] > Sent: Wednesday, 4 August 2004 1:14 PM > To: Hockaday John; expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Problems compiling expat 1.95.8 > on Solaris8platform > > > On Tuesday 03 August 2004 07:46 pm, John.Hockaday@ga.gov.au wrote: > > Thanks so much for your help. I'm sure the problem is > caused by our > > organisation's policy of not loading software into > /usr/local but your > > suggestion has got around the problem! > > Actually, I think the problem is due to stupidity in the GNU > libtool. > Unfortunately, it's a tedious system, and the Expat > contributor who set this > up for us hasn't had time to take care of our use of this > tool for a while. > (Though he has started the second of two really cool jobs > he's had since he > first implemented this for us.) > > > -Fred > > -- > Fred L. Drake, Jr. > > From fdrake at acm.org Wed Aug 4 09:33:24 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Aug 4 09:33:40 2004 Subject: [Expat-discuss] Problems compiling expat 1.95.8 on Solaris8platform In-Reply-To: References: Message-ID: <200408040333.24566.fdrake@acm.org> On Tuesday 03 August 2004 11:49 pm, John.Hockaday@ga.gov.au wrote: > That makes me feel a bit better but I've had similar troubles with > libxml2, yaz, OpenJade and Zap so I still believe not following the > standard install path of /usr/local/ has something to do with it. I don't know about the others, but I'm pretty sure libxml2 uses libtool as well. libtool is supposed to help avoid dealing with a lot of the platform-specific details of compiling and linking with dynamically loadable libraries, but it is a very "heavy" solution. I'm sure we've saved an enormous amount of work by avoiding re-discovery of many of the details it takes care of for us, but when there is a problem, it's often mysterious and hard to figure out what's really happening, and figuring out the right thing to do really requires a libtool guru. -Fred -- Fred L. Drake, Jr. From ceo at absoft-net.com Wed Aug 11 08:33:19 2004 From: ceo at absoft-net.com (Golibasku) Date: Wed Aug 11 08:33:15 2004 Subject: [Expat-discuss] Cannot link expat Message-ID: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw> I download the src code and create a new project (static library) by = using embedded visual c++ 4.0. I can compile expat without problem. But when I use the static library = in other problem. It show the following errors during linking. What is = the problem ??? ...: error LNK2019: unresolved external symbol __imp_XML_ParserFree = referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_ErrorString = referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_GetErrorCode = referenced in function ... ...: error LNK2019: unresolved external symbol = __imp_XML_GetCurrentLineNumber referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_Parse = referenced in function ... ...: error LNK2019: unresolved external symbol = __imp_XML_SetElementHandler referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_SetUserData = referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_ParserCreate = referenced in function ... From Glynn.Beeken at generaldynamics.uk.com Wed Aug 11 10:35:56 2004 From: Glynn.Beeken at generaldynamics.uk.com (Glynn Beeken) Date: Wed Aug 11 10:39:59 2004 Subject: FW: [Expat-discuss] Cannot link expat Message-ID: <4776F017F62ED311A79F0090277191700D18C564@cdccas80.compd.com> Are you using XML_STATIC as a preprocessor definition? -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of Golibasku Sent: 11 August 2004 07:33 To: expat-discuss@libexpat.org Subject: [Expat-discuss] Cannot link expat I download the src code and create a new project (static library) by using embedded visual c++ 4.0. I can compile expat without problem. But when I use the static library in other problem. It show the following errors during linking. What is the problem ??? ...: error LNK2019: unresolved external symbol __imp_XML_ParserFree referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_ErrorString referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_GetErrorCode referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_GetCurrentLineNumber referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_Parse referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_SetElementHandler referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_SetUserData referenced in function ... ...: error LNK2019: unresolved external symbol __imp_XML_ParserCreate referenced in function ... _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss General Dynamics United Kingdom Limited Registered in England and Wales No. 1911653 Registered Office: 100 New Bridge Street, London, EC4V 6JA From ceo at absoft-net.com Wed Aug 11 18:27:18 2004 From: ceo at absoft-net.com (Golibasku) Date: Wed Aug 11 18:27:15 2004 Subject: [Expat-discuss] Cannot parse simple xml References: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw> Message-ID: <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> Hello, I try to parse the following document. But it always tell me "not well-formed (invalid token) at line 1". What is the reason ?? ----------xml document------------------ Tove Jani Reminder Don't forget me this weekend --------source code----------------------- CHAR buf[100]; strcpy(buf, " Tove Jani Reminder Don't forget me this weekend "); XML_Parser parser = XML_ParserCreate(NULL); int depth = 0; XML_SetUserData(parser, &depth); XML_SetElementHandler(parser, startElement, endElement); int len = strlen(buf); if (XML_Parse(parser, buf, len, FALSE) == XML_STATUS_ERROR) { LPCTSTR err = XML_ErrorString(XML_GetErrorCode(parser)); return 1; } XML_ParserFree(parser); From fdrake at acm.org Wed Aug 11 18:44:38 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Aug 11 18:45:08 2004 Subject: [Expat-discuss] Cannot parse simple xml In-Reply-To: <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> References: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw> <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> Message-ID: <200408111244.38209.fdrake@acm.org> On Wednesday 11 August 2004 12:27 pm, Golibasku wrote: > Hello, > I try to parse the following document. But it always tell me "not > well-formed (invalid token) at line 1". What is the reason ?? > > ----------xml document------------------ > The backslashes on this line are not allowed. -Fred -- Fred L. Drake, Jr. From ceo at absoft-net.com Wed Aug 11 18:56:43 2004 From: ceo at absoft-net.com (Golibasku) Date: Wed Aug 11 18:56:39 2004 Subject: [Expat-discuss] Cannot parse simple xml References: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw> <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> <200408111244.38209.fdrake@acm.org> Message-ID: <002301c47fc4$2e812670$0100a8c0@alexcd9t4f0rbw> ----- Original Message ----- From: "Fred L. Drake, Jr." To: "Golibasku" ; Sent: Thursday, August 12, 2004 12:44 AM Subject: Re: [Expat-discuss] Cannot parse simple xml > On Wednesday 11 August 2004 12:27 pm, Golibasku wrote: > > Hello, > > I try to parse the following document. But it always tell me "not > > well-formed (invalid token) at line 1". What is the reason ?? > > > > ----------xml document------------------ > > > > The backslashes on this line are not allowed. It is just a copy and paste error. The document should be. Since I copy from my program source code, the backslashes are added Tove Jani Reminder Don't forget me this weekend From Greg.Martin at TELUS.COM Wed Aug 11 19:06:03 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Wed Aug 11 19:06:20 2004 Subject: [Expat-discuss] Cannot parse simple xml Message-ID: > -----Original Message----- > From: expat-discuss-bounces@libexpat.org=20 > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of Fred=20 > L. Drake, Jr. > Sent: Wednesday, August 11, 2004 10:45 AM > To: Golibasku; expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Cannot parse simple xml >=20 >=20 > On Wednesday 11 August 2004 12:27 pm, Golibasku wrote: > > Hello, > > I try to parse the following document. But it always=20 > tell me "not > > well-formed (invalid token) at line 1". What is the reason ?? > > > > ----------xml document------------------ > > >=20 > The backslashes on this line are not allowed. >=20 They wouldn't be in the document as per his source code. They tell the=20 compiler that the '"' are meant as part of the string not to delimit the = string. He has no new lines in the string either so line one will be the entire document. You might try putting some in - maybe there's a = non-printing character somewhere (did you copy and paste the string from somewhere)? = You=20 might get a better idea where to look. char *buf =3D "\n" " \n Tove \n" " Jani \n" " Reminder \n" " Don't forget me this weekend \n" "\n"; From regis.st-gelais at laubrass.com Wed Aug 11 19:15:50 2004 From: regis.st-gelais at laubrass.com (Regis St-Gelais) Date: Wed Aug 11 19:15:53 2004 Subject: [Expat-discuss] Cannot parse simple xml References: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw> <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> <200408111244.38209.fdrake@acm.org> <002301c47fc4$2e812670$0100a8c0@alexcd9t4f0rbw> Message-ID: <004101c47fc6$da03a2a0$6400a8c0@LAUBRASSSAG1> My xml files usualy start with: Maybee you can try it Regis ----- Original Message ----- From: Golibasku To: expat-discuss@libexpat.org Sent: Wednesday, August 11, 2004 12:56 PM Subject: Re: [Expat-discuss] Cannot parse simple xml ----- Original Message ----- From: "Fred L. Drake, Jr." To: "Golibasku" ; Sent: Thursday, August 12, 2004 12:44 AM Subject: Re: [Expat-discuss] Cannot parse simple xml > On Wednesday 11 August 2004 12:27 pm, Golibasku wrote: > > Hello, > > I try to parse the following document. But it always tell me "not > > well-formed (invalid token) at line 1". What is the reason ?? > > > > ----------xml document------------------ > > > > The backslashes on this line are not allowed. It is just a copy and paste error. The document should be. Since I copy from my program source code, the backslashes are added Tove Jani Reminder Don't forget me this weekend _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From ceo at absoft-net.com Wed Aug 11 19:37:25 2004 From: ceo at absoft-net.com (Golibasku) Date: Wed Aug 11 19:37:22 2004 Subject: [Expat-discuss] Cannot parse simple xml References: Message-ID: <002501c47fc9$de4849d0$0100a8c0@alexcd9t4f0rbw> After separating the line. The error message is "not well-formed (invalid token) at line 5 the document is: Tove Jani Reminder Don't forget me this weekend > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > To: Golibasku; expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] Cannot parse simple xml > > > On Wednesday 11 August 2004 12:27 pm, Golibasku wrote: > > Hello, > > I try to parse the following document. But it always > tell me "not > > well-formed (invalid token) at line 1". What is the reason ?? > > > > ----------xml document------------------ > > > > The backslashes on this line are not allowed. > They wouldn't be in the document as per his source code. They tell the compiler that the '"' are meant as part of the string not to delimit the string. He has no new lines in the string either so line one will be the entire document. You might try putting some in - maybe there's a non-printing character somewhere (did you copy and paste the string from somewhere)? You might get a better idea where to look. char *buf = "\n" " \n Tove \n" " Jani \n" " Reminder \n" " Don't forget me this weekend \n" "\n"; From jez at jezuk.co.uk Wed Aug 11 20:10:59 2004 From: jez at jezuk.co.uk (Jez Higgins) Date: Wed Aug 11 20:11:27 2004 Subject: [Expat-discuss] Cannot parse simple xml In-Reply-To: <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> Message-ID: <411A6F43.1450.743E103@localhost> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Hello, > I try to parse the following document. But it always tell me "not > well-formed (invalid token) at line 1". What is the reason ?? > > CHAR buf[100]; > strcpy(buf, " Tove > Jani > Reminder Don't forget me this > weekend "); Looks to me like your buffer is too small. Your XML doc is over 100 chars long, so it's just luck the you haven't smashed the stack with that strcpy. Try increasing the size of your buffer and seeing what happens. Jez -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) iD8DBQFBGmEzd5Jqiw9+jCsRAp9uAJ4l0BRHg2Jm3dELGuJTCN8thbICzQCeOYzO H8byzPBbehzbLU4WrfoKWRA= =cTUS -----END PGP SIGNATURE----- From fdrake at acm.org Wed Aug 11 20:33:35 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Aug 11 20:33:45 2004 Subject: [Expat-discuss] Cannot parse simple xml In-Reply-To: <411A6F43.1450.743E103@localhost> References: <411A6F43.1450.743E103@localhost> Message-ID: <200408111433.35689.fdrake@acm.org> On Wednesday 11 August 2004 02:10 pm, Jez Higgins wrote: > Looks to me like your buffer is too small. Your XML doc is over 100 > chars long, so it's just luck the you haven't smashed the stack with > that strcpy. Nice catch! Another possibility is to avoid the copy completely, but that might be more tedious in the real application. -Fred -- Fred L. Drake, Jr. From ceo at absoft-net.com Thu Aug 12 03:43:06 2004 From: ceo at absoft-net.com (Golibasku) Date: Thu Aug 12 03:43:02 2004 Subject: [Expat-discuss] Cannot parse simple xml References: <411A6F43.1450.743E103@localhost> Message-ID: <003401c4800d$b747e950$0100a8c0@alexcd9t4f0rbw> Yes, it is the buffer size problem. Thank you. :-) ----- Original Message ----- To: Sent: Thursday, August 12, 2004 2:10 AM Subject: Re: [Expat-discuss] Cannot parse simple xml > > Hello, > > I try to parse the following document. But it always tell me "not > > well-formed (invalid token) at line 1". What is the reason ?? > > > > > CHAR buf[100]; > > strcpy(buf, " Tove > > Jani > > Reminder Don't forget me this > > weekend "); > > Looks to me like your buffer is too small. Your XML doc is over 100 > chars long, so it's just luck the you haven't smashed the stack with > that strcpy. > > Try increasing the size of your buffer and seeing what happens. From xcaron at atmel.fr Wed Aug 11 18:32:00 2004 From: xcaron at atmel.fr (Xavier Caron) Date: Thu Aug 12 17:12:18 2004 Subject: [Expat-discuss] Cannot parse simple xml In-Reply-To: <001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> References: <17da01c47f6d$184319b0$0100a8c0@alexcd9t4f0rbw><001301c47fc0$12d3b810$0100a8c0@alexcd9t4f0rbw> Message-ID: <20040811183200.3ba60725.xcaron@atmel.fr> Hi, > ^ ^ AFAIR, these should be either ' or ", no escaping allowed. Hope this helps. Cheers, X. From opengeometry at yahoo.ca Sat Aug 14 08:37:46 2004 From: opengeometry at yahoo.ca (William Park) Date: Sat Aug 14 08:38:02 2004 Subject: [Expat-discuss] CharacterDataHandler -- why no element name? Message-ID: <20040814063746.GA7493@node1.opengeometry.net> Hi all, After reading the documentation of Expat-1.95.8, I am wondering why the callback function for text data, as in void XMLCALL texthandler (userData, s, len) void *userData; char *s; int len; { ... } XML_SetCharacterDataHandler(p, texthandler) doesn't get element name as argument. Without it, I don't know which element this text belongs to, and have to keep track of previous elements which were opened/closed. Shouldn't the parser be the one keeping track? -- William Park Open Geometry Consulting, Toronto, Canada From jayesh at cins.unipune.ernet.in Tue Aug 17 13:55:42 2004 From: jayesh at cins.unipune.ernet.in (jayesh) Date: Tue Aug 17 13:51:54 2004 Subject: [Expat-discuss] FW: buffer get fulled Message-ID: <000501c48451$1f53a790$1501080a@cins.unipune.ernet.in> -----Original Message----- From: jayesh [mailto:jayesh@cins.unipune.ernet.in] Sent: Tuesday, August 17, 2004 5:18 PM To: 'expat-discuss@libexpat.org' Subject: buffer get fulled Hi friends, I am writing a small program for xml parsing, I used source code from examples of expat I have specified my static buffer size of 1024, It parses well but as soon as the size of the file increases it is not able to parse Please give me the solution With regards, Jayesh shah From jayesh at cins.unipune.ernet.in Tue Aug 17 13:48:05 2004 From: jayesh at cins.unipune.ernet.in (jayesh) Date: Tue Aug 17 16:15:51 2004 Subject: [Expat-discuss] buffer get fulled Message-ID: <000001c48450$0f25c480$1501080a@cins.unipune.ernet.in> Hi friends, I am writing a small program for xml parsing, I used source code from examples of expat I have specified my static buffer size of 1024, It parses well but as soon as the size of the file increases it is not able to parse Please give me the solution Here is my code: #include #include #include #include #include #define BUFFSIZE 1024 using namespace std; class ParseXml { public: XML_Parser parser; static string s_line; static string p_str[20]; static int i_count; static void xmlstart(void *userData, const char *el,const char **attr) { int i; s_line = ""; for (i = 0; attr[i]; i += 2) { s_line+=attr[i+1]; s_line+=" "; } p_str[i_count++]=s_line; int *depthPtr=(int *)userData; *depthPtr++; } static void endElement(void *userData, const char *name) { int *depthPtr = (int *)userData; *depthPtr -= 1; } string *parseNode() { parser = XML_ParserCreate(NULL); FILE *fr; long buffsize; fr=fopen("./configuration.xml","r"); fseek(fr,0,SEEK_END); buffsize=ftell(fr); printf("%ld",buffsize); fclose(fr); buffsize=buffsize+200; char Buff[buffsize]; int done; int depth = 0,k = 0; XML_SetUserData(parser, &depth); XML_SetElementHandler(parser,xmlstart,endElement); for (;;) { int done; int len; fr = fopen("./configuration.xml", "r"); len = fread(Buff, 1,buffsize, fr); if (ferror(fr)) { printf("Read error"); return 0; } done = feof(fr); if (XML_Parse(parser, Buff, len, done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); return 0; } if (done) { fclose(fr); XML_ParserFree(parser); p_str[i_count]="stop"; return p_str; } } } }; string ParseXml :: s_line = "" ; int ParseXml :: i_count = 0 ; string ParseXml :: p_str[20] ; int main() { int k=0; string *temp=(string *)malloc(110); ParseXml p1; temp=p1.parseNode(); /* while(temp[k]!="stop") { std::cout << temp[k] << endl; k++; } */ exit(0); } With regards, Jayesh shah From Greg.Martin at TELUS.COM Tue Aug 17 21:33:52 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Tue Aug 17 21:33:20 2004 Subject: [Expat-discuss] CharacterDataHandler -- why no element name? Message-ID: > -----Original Message----- > From: expat-discuss-bounces+greg.martin=telus.com@libexpat.org > [mailto:expat-discuss-bounces+greg.martin=telus.com@libexpat.org]On > Behalf Of William Park > Sent: Saturday, August 14, 2004 12:38 AM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] CharacterDataHandler -- why no element name? > > > Hi all, > > After reading the documentation of Expat-1.95.8, I am > wondering why the > callback function for text data, as in > > void XMLCALL texthandler (userData, s, len) > void *userData; > char *s; > int len; > { ... } > > XML_SetCharacterDataHandler(p, texthandler) > > doesn't get element name as argument. Without it, I don't know which > element this text belongs to, and have to keep track of previous > elements which were opened/closed. Shouldn't the parser be the one > keeping track? > It's not required. The document gets parsed sequentially so the element being parsed is the last one passed to the start element handler. From opengeometry at yahoo.ca Tue Aug 17 23:28:56 2004 From: opengeometry at yahoo.ca (William Park) Date: Wed Aug 18 01:17:27 2004 Subject: [Expat-discuss] CharacterDataHandler -- why no element name? In-Reply-To: References: Message-ID: <20040817212856.GA3097@node1.opengeometry.net> On Tue, Aug 17, 2004 at 12:33:52PM -0700, Greg Martin wrote: > > Hi all, > > > > After reading the documentation of Expat-1.95.8, I am wondering why > > the callback function for text data, as in > > > > void XMLCALL texthandler (userData, s, len) > > void *userData; > > char *s; > > int len; > > { ... } > > > > XML_SetCharacterDataHandler(p, texthandler) > > > > doesn't get element name as argument. Without it, I don't know > > which element this text belongs to, and have to keep track of > > previous elements which were opened/closed. Shouldn't the parser be > > the one keeping track? > > > > It's not required. The document gets parsed sequentially so the > element being parsed is the last one passed to the start element > handler. Given the following, ... ... text when data handler gets 'text', I have to keep a stack to know that 'text' is within not element. Parser already does this kind of bookkeeping. So, if user is given the name of currently active element, it would mean that he doesn't have to keep a stack. Of course, if he needs previous 2 elements, then he would need to do a stack. But, single element case would be the majority. -- William Park Open Geometry Consulting, Toronto, Canada From Greg.Martin at TELUS.COM Thu Aug 19 16:03:13 2004 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Thu Aug 19 16:02:36 2004 Subject: [Expat-discuss] CharacterDataHandler -- why no element name? Message-ID: > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org]On Behalf Of William Park > Sent: Tuesday, August 17, 2004 3:29 PM > To: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] CharacterDataHandler -- why no element > name? > > > On Tue, Aug 17, 2004 at 12:33:52PM -0700, Greg Martin wrote: > > > Hi all, > > > > > > After reading the documentation of Expat-1.95.8, I am > wondering why > > > the callback function for text data, as in > > > > > > void XMLCALL texthandler (userData, s, len) > > > void *userData; > > > char *s; > > > int len; > > > { ... } > > > > > > XML_SetCharacterDataHandler(p, texthandler) > > > > > > doesn't get element name as argument. Without it, I don't know > > > which element this text belongs to, and have to keep track of > > > previous elements which were opened/closed. Shouldn't > the parser be > > > the one keeping track? > > > > > > > It's not required. The document gets parsed sequentially so the > > element being parsed is the last one passed to the start element > > handler. > > Given the following, > ... > ... > text > > when data handler gets 'text', I have to keep a stack to know that > 'text' is within not element. > > Parser already does this kind of bookkeeping. So, if user is > given the > name of currently active element, it would mean that he > doesn't have to > keep a stack. > > Of course, if he needs previous 2 elements, then he would need to do a > stack. But, single element case would be the majority. Correct, my answer was over simplified and I haven't looked in the source to see if in fact the current element is being stored. Personally, I never use Expat without storing that information so it hasn't been a problem. From gnu at gunzour.net Thu Aug 26 17:19:56 2004 From: gnu at gunzour.net (Doug Granzow) Date: Thu Aug 26 17:20:04 2004 Subject: [Expat-discuss] make install problem - lib/expat_external.h Message-ID: <20040826151956.65318.qmail@web108.biz.mail.yahoo.com> I am attempting to build and install Expat 1.95.8 on Solaris 8 with gcc. "configure; make; make install" all run without errors, but the file lib/expat_external.h does not get installed. Here is a line of output from "make install": conftools/install-sh -c -m 644 ./lib/expat.h ./lib/expat_external.h /opt/DCIexpat/1.95.8/include But only one file got installed: bash-2.03# ls -l /opt/DCIexpat/1.95.8/include/ total 80 -rw-r--r-- 1 root other 40115 Aug 26 10:03 expat.h bash-2.03# pwd Here is an excerpt from conftools/install-sh: # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. It looks like make is trying to install both files with one call to install-sh, although install-sh doesn't support it. From kjackson at crimebucket.com Fri Aug 27 07:09:26 2004 From: kjackson at crimebucket.com (Keith Jackson) Date: Fri Aug 27 07:09:22 2004 Subject: [Expat-discuss] XML/expat question/problem? Message-ID: <04e101c48bf4$061f4450$0200a8c0@bastard> Hello everyone. First, let me say that if this is a problem because of my limited knowledge of XML, please feel free to flame me. That being said... I have an XML file that is not parsing. Perhaps one of you XML savvy folks could take half a second to see what is going on.. Included is the file. I've stepped thru the parsing, and in the last 'Control' section (there are three), expat returns XML_ERROR_INVALID_TOKEN. The last handler called was the EndNode handler, with the last 'From' node in the XML document. We never hit the EndNode handler for the last 'Animation'. I find it hard to believe there would be a bug in expat, so I'm assuming I'm doing something stupid I shouldn't be doing in XML. Anyway, thanks guys. Expat is great. It's nice to not have to use all the crazy infrastructure and stuff that comes along with SAX and DOM. Keith Jackson -------------- next part -------------- A non-text attachment was scrubbed... Name: Skin.xml Type: text/xml Size: 1052 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20040826/ff104f8d/Skin.xml From John.Hockaday at ga.gov.au Fri Aug 27 07:37:56 2004 From: John.Hockaday at ga.gov.au (John.Hockaday@ga.gov.au) Date: Fri Aug 27 07:38:48 2004 Subject: [Expat-discuss] XML/expat question/problem? Message-ID: Hi Keith, I'm not 100% sure of expat but I do know a little about XML and your document is not an XML document instance. Officially the very first line of an XML document instance *must* be: This tells a parser that it is an XML document. Once you have done this then you can only check your XML document instance for 'well formed ness". That is that all opened tags are closed or empty and that nesting occurs properly. I have added the above line to your document and it is "well formed". If you want to validate it against a structure you must enter a reference to a "DOCTYPE" or an "XSD". The former is a reference to a Document Type Definition (DTD) that defines the structure that your XML document instances must comply to when validated. The XSD is an eXtensible Schema Definition. There are many of these. Eg. W3C XML Schema, RELAXNG. These not only define the structure that the XML document instances must follow (like the DTD) but also some format for the content of the XML elements. Eg. Dates, integers, strings. Someone else will have to answers the expat errors. I hope that this helps. John > -----Original Message----- > From: Keith Jackson [mailto:kjackson@crimebucket.com] > Sent: Friday, 27 August 2004 3:09 PM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] XML/expat question/problem? > > > Hello everyone. First, let me say that if this is a problem because of > my limited knowledge of XML, please feel free to flame me. > > That being said... I have an XML file that is not parsing. Perhaps one > of you XML savvy folks could take half a second to see what is going > on.. Included is the file. I've stepped thru the parsing, and in the > last 'Control' section (there are three), expat returns > XML_ERROR_INVALID_TOKEN. The last handler called was the EndNode > handler, with the last 'From' node in the XML document. We > never hit the > EndNode handler for the last 'Animation'. > > I find it hard to believe there would be a bug in expat, so > I'm assuming > I'm doing something stupid I shouldn't be doing in XML. Anyway, thanks > guys. Expat is great. It's nice to not have to use all the crazy > infrastructure and stuff that comes along with SAX and DOM. > > Keith Jackson > > From kjackson at crimebucket.com Fri Aug 27 07:59:47 2004 From: kjackson at crimebucket.com (Keith Jackson) Date: Fri Aug 27 07:59:41 2004 Subject: [Expat-discuss] XML/expat question/problem? In-Reply-To: Message-ID: <04f001c48bfb$0e92f260$0200a8c0@bastard> Thanks for the reply. I added that line to my document as well, but expat is still complaining as before. I will try to learn more abou schemas and what not, though, I'm beginning to think it may be a problem with expat? Feel free to beat me with a stick. Keith Jackson -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org] On Behalf Of John.Hockaday@ga.gov.au Sent: Thursday, August 26, 2004 10:38 PM To: expat-discuss@libexpat.org Subject: RE: [Expat-discuss] XML/expat question/problem? Hi Keith, I'm not 100% sure of expat but I do know a little about XML and your document is not an XML document instance. Officially the very first line of an XML document instance *must* be: This tells a parser that it is an XML document. Once you have done this then you can only check your XML document instance for 'well formed ness". That is that all opened tags are closed or empty and that nesting occurs properly. I have added the above line to your document and it is "well formed". If you want to validate it against a structure you must enter a reference to a "DOCTYPE" or an "XSD". The former is a reference to a Document Type Definition (DTD) that defines the structure that your XML document instances must comply to when validated. The XSD is an eXtensible Schema Definition. There are many of these. Eg. W3C XML Schema, RELAXNG. These not only define the structure that the XML document instances must follow (like the DTD) but also some format for the content of the XML elements. Eg. Dates, integers, strings. Someone else will have to answers the expat errors. I hope that this helps. John > -----Original Message----- > From: Keith Jackson [mailto:kjackson@crimebucket.com] > Sent: Friday, 27 August 2004 3:09 PM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] XML/expat question/problem? > > > Hello everyone. First, let me say that if this is a problem because of > my limited knowledge of XML, please feel free to flame me. > > That being said... I have an XML file that is not parsing. Perhaps one > of you XML savvy folks could take half a second to see what is going > on.. Included is the file. I've stepped thru the parsing, and in the > last 'Control' section (there are three), expat returns > XML_ERROR_INVALID_TOKEN. The last handler called was the EndNode > handler, with the last 'From' node in the XML document. We > never hit the > EndNode handler for the last 'Animation'. > > I find it hard to believe there would be a bug in expat, so > I'm assuming > I'm doing something stupid I shouldn't be doing in XML. Anyway, thanks > guys. Expat is great. It's nice to not have to use all the crazy > infrastructure and stuff that comes along with SAX and DOM. > > Keith Jackson > > _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From kjackson at crimebucket.com Fri Aug 27 08:17:46 2004 From: kjackson at crimebucket.com (Keith Jackson) Date: Fri Aug 27 08:17:41 2004 Subject: [Expat-discuss] XML/expat question/problem? In-Reply-To: <04f001c48bfb$0e92f260$0200a8c0@bastard> Message-ID: <04f501c48bfd$91f33b40$0200a8c0@bastard> Alright, I figured it out. Sorry for bothering everyone. :) Apparently, XML_GetBuffer() has to be called before every call to XML_ParseBuffer(). I was getting a buffer of 1k and then just re-using it. My XML doc just happened to go over 1k, and that's when the problems started. :P Thanks again for a great library. Keith Jackson -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org] On Behalf Of Keith Jackson Sent: Thursday, August 26, 2004 11:00 PM To: expat-discuss@libexpat.org Subject: RE: [Expat-discuss] XML/expat question/problem? Thanks for the reply. I added that line to my document as well, but expat is still complaining as before. I will try to learn more abou schemas and what not, though, I'm beginning to think it may be a problem with expat? Feel free to beat me with a stick. Keith Jackson -----Original Message----- From: expat-discuss-bounces@libexpat.org [mailto:expat-discuss-bounces@libexpat.org] On Behalf Of John.Hockaday@ga.gov.au Sent: Thursday, August 26, 2004 10:38 PM To: expat-discuss@libexpat.org Subject: RE: [Expat-discuss] XML/expat question/problem? Hi Keith, I'm not 100% sure of expat but I do know a little about XML and your document is not an XML document instance. Officially the very first line of an XML document instance *must* be: This tells a parser that it is an XML document. Once you have done this then you can only check your XML document instance for 'well formed ness". That is that all opened tags are closed or empty and that nesting occurs properly. I have added the above line to your document and it is "well formed". If you want to validate it against a structure you must enter a reference to a "DOCTYPE" or an "XSD". The former is a reference to a Document Type Definition (DTD) that defines the structure that your XML document instances must comply to when validated. The XSD is an eXtensible Schema Definition. There are many of these. Eg. W3C XML Schema, RELAXNG. These not only define the structure that the XML document instances must follow (like the DTD) but also some format for the content of the XML elements. Eg. Dates, integers, strings. Someone else will have to answers the expat errors. I hope that this helps. John > -----Original Message----- > From: Keith Jackson [mailto:kjackson@crimebucket.com] > Sent: Friday, 27 August 2004 3:09 PM > To: expat-discuss@libexpat.org > Subject: [Expat-discuss] XML/expat question/problem? > > > Hello everyone. First, let me say that if this is a problem because of > my limited knowledge of XML, please feel free to flame me. > > That being said... I have an XML file that is not parsing. Perhaps one > of you XML savvy folks could take half a second to see what is going > on.. Included is the file. I've stepped thru the parsing, and in the > last 'Control' section (there are three), expat returns > XML_ERROR_INVALID_TOKEN. The last handler called was the EndNode > handler, with the last 'From' node in the XML document. We > never hit the > EndNode handler for the last 'Animation'. > > I find it hard to believe there would be a bug in expat, so > I'm assuming > I'm doing something stupid I shouldn't be doing in XML. Anyway, thanks > guys. Expat is great. It's nice to not have to use all the crazy > infrastructure and stuff that comes along with SAX and DOM. > > Keith Jackson > > _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From sb at dod.no Sun Aug 29 20:23:46 2004 From: sb at dod.no (Steinar Bang) Date: Sun Aug 29 20:31:10 2004 Subject: [Expat-discuss] Conflict with two expat shared libraries Message-ID: <871xhpajm5.fsf@dod.no> Platform: Intel Pentium M, debian sarge (testing/unstable), libexpat1 1.95.6-8, libqt3c102-mt, fontconfig 2.2.3-1 After an apt-get dist-upgrade, my own Qt application got a strange error. It printed out the following lines to the console Fontconfig error: line 1: unknown encoding Fontconfig error: Cannot load default config file and started up with a strange-looking font called "Arioso", when what I expected was Helvetica. I traced this down to the application being linked with two separate expat shared libraries, the one native to debian sarge, used by fontconfig to read its configuration files, and a different version used with my application. The problem is that the native expat on debian sarge is compiled to use single width char with UTF-8, while the version used by my application is compiled to use unsigned short with UTF-16 (to be a best fit to QString and QConstString). As I see it, I have the following paths open to me: 1. convert my application to use the UTF-8 API, and use the native shared lib for everything 2. create an extra header file, which prefixes all symbols of my application's version of expat with some "prefix_" 3. manually edit my application's version of expat, and add "prefix_" to all non-static symbols Does anyone have any better ideas? I'm open to all suggestions. I have already tried alternative 1, and I know that works. My application started up without the fonconfig error messages, and using Helvetica as its font. But this approach will give me a serious performance hit when parsing big XML files, because of the added string copying and UTF-8 to UTF-16 conversion. I'd rather avoid alternative 3 if I can. I prefer to keep the expat source in local CVS as pristine as possible, to ease upgrades. I'm currently trying to do 2. with the help of a perl script. But according to "nm -op" there's a lot of exported symbols in an expat shared lib... so far I haven't been successful in eliminating the error. One thing I tried, that didn't work out, was to make my application's version of expat be a static lib, with the .o files compiled with -fPIC. That just made the shared library linked with expat (my application consists of a lot of shared libraries) export the symbols that conflicted with the native expat. As I said, I'm open to suggestions! Thanx! - Steinar From karl at waclawek.net Mon Aug 30 04:58:31 2004 From: karl at waclawek.net (Karl Waclawek) Date: Mon Aug 30 04:58:34 2004 Subject: [Expat-discuss] Conflict with two expat shared libraries References: <871xhpajm5.fsf@dod.no> Message-ID: <002101c48e3d$3bc7b6f0$0300a8c0@karlglen188> ----- Original Message ----- From: "Steinar Bang" To: Sent: Sunday, August 29, 2004 2:23 PM > I traced this down to the application being linked with two separate > expat shared libraries, the one native to debian sarge, used by > fontconfig to read its configuration files, and a different version > used with my application. > > The problem is that the native expat on debian sarge is compiled to > use single width char with UTF-8, while the version used by my > application is compiled to use unsigned short with UTF-16 (to be a > best fit to QString and QConstString). > > As I see it, I have the following paths open to me: > 1. convert my application to use the UTF-8 API, and use the native > shared lib for everything > 2. create an extra header file, which prefixes all symbols of my > application's version of expat with some "prefix_" > 3. manually edit my application's version of expat, and add "prefix_" > to all non-static symbols You can also load the UTF-16 version of Expat dynamically using dlopen() and dlsym(). Karl