From burton at tailrank.com Fri Aug 1 03:52:46 2008 From: burton at tailrank.com (Kevin Burton) Date: Thu, 31 Jul 2008 18:52:46 -0700 Subject: [Expat-discuss] Performance tuning of character data callbacks.... Message-ID: <30c6373b0807311852u5e07af49ga1f931d3c194225b@mail.gmail.com> Hey guys. How do I increase the size of the buffer used with character data callbacks? Looks like this is XML_CONTENT_BYTES by my 15 minutes of groking the source which defaults to 1024.... I might bump this up to 16-32k. ..... I'm debugging the use of PHP's integration of Expat for parsing of large documents. Looks like there are two problems that I can see....... In this case, parsing a 500k XML document takes expat about 200ms..... which is fast. The problem is that php adds an extra 600ms to handle callbacks. Simply calling empty methods adds another 300ms and using string concat in php adds another 300ms on top of that. I think can be reduced by increasing the chunk size of character data which would both reduce the number of callbacks and reduce the number of string concats needed by my application. Kevin -- Founder/CEO Tailrank.com Location: San Francisco, CA AIM/YIM: sfburtonator Skype: burtonator Work: http://spinn3r.com and http://tailrank.com Blog: http://feedblog.org Fax: 1-415-358-4198 PIN: 0092 From webmaster at hartwork.org Sun Aug 3 15:53:32 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 15:53:32 +0200 Subject: [Expat-discuss] Expat's XML_Parse() method does not return In-Reply-To: <001401c8ef7d$a80e7790$0201a8c0@JEMAS> References: <001401c8ef7d$a80e7790$0201a8c0@JEMAS> Message-ID: <4895B85C.30506@hartwork.org> James Kim wrote: > 1.. void > 2.. XMLParser::ParseXML(BFile* file) > 3.. { > 4.. char msg[1024]; > 5.. > 6.. XML_Parser parser = XML_ParserCreate(NULL); > 7.. XML_SetUserData(parser, this); > 8.. XML_SetElementHandler(parser, StartElementHandler, EndElementHandler); > 9.. XML_SetCharacterDataHandler(parser, CharDataHandler); > 10.. > 11.. bool done = false; > 12.. do { > 13.. ssize_t len = file->Read(fBuffer, BUFSIZ); > 14.. if (len < BUFSIZ) { > 15.. done = true; > 16.. } Does file->Read() return 0 or -1 on EOF? Is the filesize a multiple of BUFSIZ? Have you tried without handlers set? > 17.. if (!XML_Parse(parser, fBuffer, len, done)) { > 18.. sprintf(msg, "%s at line %d\n", > 19.. XML_ErrorString(XML_GetErrorCode(parser)), > 20.. XML_GetCurrentLineNumber(parser)); > 21.. printf(msg); > 22.. } > 23.. } while (!done); > 24.. > 25.. XML_ParserFree(parser); > 26.. } Sebastian From webmaster at hartwork.org Sun Aug 3 16:00:32 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 16:00:32 +0200 Subject: [Expat-discuss] [resend] cannot compile .c files under Expat 2.0.1\Source\examples folder :( In-Reply-To: References: Message-ID: <4895BA00.5080706@hartwork.org> yuki latt wrote: > Error E2209 outline.c 25: Unable to open include file 'stdio.h' > Error E2209 outline.c 26: Unable to open include file 'expat.h' This is not an Expat problem. Something is wrong with your include paths setup. Sebastian From webmaster at hartwork.org Sun Aug 3 16:21:04 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 16:21:04 +0200 Subject: [Expat-discuss] Error: Unresolved external '_XML_ParserCreate' referenced from ... elements.exe In-Reply-To: References: Message-ID: <4895BED0.7020907@hartwork.org> yuki latt wrote: > bcc32 -I"C:\Program Files\Expat 2.0.1\Source\lib" -L"C:\Program Files\Expat > 2.0.1\Source\lib" -o"C:\Program Files\Expat > 2.0.1\Source\examples\elements.exe" elements.c > Error: Unresolved external '_XML_ParserCreate' referenced from C:\PROGRAM > FILES\EXPAT 2.0.1\SOURCE\EXAMPLES\ELEMENTS.EXE You need to link against the Expat library or its sources in order to fix this. It doesn't look like you're doing that. Sebastian From webmaster at hartwork.org Sun Aug 3 16:21:38 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 16:21:38 +0200 Subject: [Expat-discuss] Need help on installing expat 2.0.1 with w3c-libwww In-Reply-To: <956790249DB95A44BCAF592F57BDB97DCF9C8E@sl-ecs-mail-01.slecs.ca> References: <956790249DB95A44BCAF592F57BDB97DCF9C8E@sl-ecs-mail-01.slecs.ca> Message-ID: <4895BEF2.20002@hartwork.org> Picard, Philippe wrote: > I am trying to upgrade my w3c-libwww package with a new XML parser. I am trying to install expat 2.0.1. I can compile expat on its own but I need help on how to interface it with w3c-libwww. > How do I replace the w3c-libwww xmlparse with expat? > I am running on Linux. Please be more precise. What exactly are you trying to do? Sebastian From webmaster at hartwork.org Sun Aug 3 16:51:35 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 16:51:35 +0200 Subject: [Expat-discuss] Performance tuning of character data callbacks.... In-Reply-To: <30c6373b0807311852u5e07af49ga1f931d3c194225b@mail.gmail.com> References: <30c6373b0807311852u5e07af49ga1f931d3c194225b@mail.gmail.com> Message-ID: <4895C5F7.70001@hartwork.org> Kevin Burton wrote: > How do I increase the size of the buffer used with character data callbacks? > > Looks like this is XML_CONTENT_BYTES by my 15 minutes of groking the source > which defaults to 1024.... I might bump this up to 16-32k. > I think can be reduced by increasing the chunk size of character data which > would both reduce the number of callbacks and reduce the number of string > concats needed by my application. Are you suggesting to change the default value? I'm not sure if this suits everyone as Expat is used in environments with very little memory. Sebastian From webmaster at hartwork.org Sun Aug 3 17:04:11 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 03 Aug 2008 17:04:11 +0200 Subject: [Expat-discuss] Bad characters in document In-Reply-To: References: Message-ID: <4895C8EB.5080002@hartwork.org> Frank P Esposito wrote: > Is there a way to get a "call back" from expat that it scanned a bad > utf-8 sequence? > > Now, if that is the case, the scanner stops and returnes to the caller I don't think there is such a thing. I guess you will have to preprocess the string you pass to Expat. Sebastian From burton at tailrank.com Sun Aug 3 18:28:55 2008 From: burton at tailrank.com (Kevin Burton) Date: Sun, 3 Aug 2008 09:28:55 -0700 Subject: [Expat-discuss] Performance tuning of character data callbacks.... In-Reply-To: <4895C5F7.70001@hartwork.org> References: <30c6373b0807311852u5e07af49ga1f931d3c194225b@mail.gmail.com> <4895C5F7.70001@hartwork.org> Message-ID: <30c6373b0808030928p5a60678aj20640f48be21955f@mail.gmail.com> No.... I'm saying I'll just recompile on my machine if this yields a performance boost. Also, couldn't it just be a tunable config param? Kevin On Sun, Aug 3, 2008 at 7:51 AM, Sebastian Pipping wrote: > Kevin Burton wrote: > >> How do I increase the size of the buffer used with character data >> callbacks? >> >> Looks like this is XML_CONTENT_BYTES by my 15 minutes of groking the >> source >> which defaults to 1024.... I might bump this up to 16-32k. >> > > I think can be reduced by increasing the chunk size of character data >> which >> would both reduce the number of callbacks and reduce the number of string >> concats needed by my application. >> > > Are you suggesting to change the default value? I'm not sure if this > suits everyone as Expat is used in environments with very little > memory. > > > > Sebastian > -- Founder/CEO Tailrank.com Location: San Francisco, CA AIM/YIM: sfburtonator Skype: burtonator Work: http://spinn3r.com and http://tailrank.com Blog: http://feedblog.org Fax: 1-415-358-4198 PIN: 0092 From yuki.latt at gmail.com Tue Aug 5 03:32:32 2008 From: yuki.latt at gmail.com (yuki latt) Date: Tue, 5 Aug 2008 10:32:32 +0900 Subject: [Expat-discuss] extracting value other than element and attribute In-Reply-To: References: Message-ID: Hello, Thank you so much for your kind help. I am sorry to bother you again and again. Although I have tried it in several ways, I havent get it yet. My simple xml file is as follows. (real xml file is sooo huge) Mr. Smith Mr. Clark I want to extract the names of the heads of all departments ( Mr. Smith). Followings are my dirty codes. :) ----------------------------------------------------------------------------------- void XMLCALL elementText(void *userData,const char *xmlData,int len) { char* startTag = ""; char* endTag = ""; char* startLocation; char* endLocation; char* tempString=NULL; int tempLength; while(strstr(xmlData,startTag)!=NULL) { // find the length of string of " ... startLocation = strstr(xmlData,startTag)+strlen(startTag); // find the length of string of " ... endLocation = strstr(xmlData,endTag); //Find the end of your string // find the difference tempLength = endLocation - startLocation; //Calculate the length of the string // allocate the memory for tempString tempString = malloc(tempLength); // Copy string to tempString ( it will be Mr. Smith) strncpy(tempString,startLocation,tempLength); //Extract your string printf("%s \n",tempString); free(tempString); break; } } If there is only one entry for as above, it works. But the program still prints Mr. Smith for 4 times. I dont know how to handle it. :( If there is two entries for Head as follows Mr. Smith Mr. Clark Mr. James Mr. Paul ) the program shows the following erros- 12 [main] my_exe 416 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack) Segmentation fault (core dumped) Any help would be much appreciated. regards, yuki From yuki.latt at gmail.com Tue Aug 5 03:44:15 2008 From: yuki.latt at gmail.com (yuki latt) Date: Tue, 5 Aug 2008 10:44:15 +0900 Subject: [Expat-discuss] extracting value other than element and attribute In-Reply-To: References: Message-ID: Hello, My problem is solved. :) I found three things. 1) XML file should not have unnecessary indent between tag. 2) I have to reallocate the memory to avoid core dumped. 3) To get rid of recursive calls, I used break for while loop of "while(strstr(xmlData,"")!=NULL)". After searching xmlData until end_tag is found no more, while loop stop. Thank you so much for your ideas and kind help. :) regards, yuki From nickmacd at gmail.com Tue Aug 5 07:31:45 2008 From: nickmacd at gmail.com (Nick MacDonald) Date: Tue, 5 Aug 2008 01:31:45 -0400 Subject: [Expat-discuss] extracting value other than element and attribute In-Reply-To: References: Message-ID: Yuki: Based on the code you sent, I don't think you're doing it quite correctly and while it might happen to work, its not guaranteed to keep working. You need to detect the tags in the start tag function, not in the element text function. The element text function doesn't happen to terminate the whole body of the document, which is why I think your code happens to work... by accident... BTW, that XML file is not very well designed... what you really want is something better, like this: Bob Smith Jane Jones John Doe But I guess that's a matter of personal taste... Based on that file, what you really want it something like this pseudo-code: StartTag Callback: If (0 == strcmp(tagPassedIntoCallback, "DeptHead")) { // this is the tag we're interested in... CurrentTagIsHead =true; } else { CurrentTagIsHead=false; if (0 == strcmp(tagPassedIntoCallback, "Dept")) { currentDeptName=findNameParameter(numparametersPassedToCallback, ParameterListPassedToCallback); } } Body Text Callback: if (CurrentTagIsHead) { deptHeadName=makeStringCopyOfTextPassedIntoCallback; printf("Head of department %s is %s\n", currentDeptName, deptHeadName); } As you can see.. do strstr() totally defeats the purpose of using eXpat, because now you are trying to parse the XML instead of letting it do all the work for you. You need to realize that eXpat is event driven, and that you need to use global state to track the current state of your parsing in the file, which is what I implied in the pseudo code above... Good luck... Nick On Mon, Aug 4, 2008 at 9:44 PM, yuki latt wrote: > My problem is solved. :) I found three things. > > 1) XML file should not have unnecessary indent between tag. > > 2) I have to reallocate the memory to avoid core dumped. > > 3) To get rid of recursive calls, I used break for while loop of > "while(strstr(xmlData,"")!=NULL)". After searching xmlData until > end_tag is found no more, while loop stop. > > > Thank you so much for your ideas and kind help. :) From Philippe.Picard at slecs.ca Mon Aug 4 14:29:03 2008 From: Philippe.Picard at slecs.ca (Picard, Philippe) Date: Mon, 4 Aug 2008 08:29:03 -0400 Subject: [Expat-discuss] Need help on installing expat 2.0.1 with w3c-libwww Message-ID: <956790249DB95A44BCAF592F57BDB97DB02170@sl-ecs-mail-01.slecs.ca> I already found and fixed the problem. Thanks anyway. AVIS DE CONFIDENTIALIT? - Ce message est pour l'usage exclusif du (des) destinataire(s) mentionn?(s) ci-dessus. Il peut contenir de l'information privil?gi?e, propri?taire, confidentielle et/ou dispens?e de divulgation par la loi. Si vous n'?tes pas un destinataire nomm? ou si vous l'avez re?u par erreur, veuillez en aviser imm?diatement l'exp?diteur et l'effacer sans le copier ni le divulguer ? quiconque, ni n'en faire aucun usage. CONFIDENTIALITY NOTICE - This communication is for the exclusive use of the above-named recipient(s). It may contain information that is privileged, proprietary, confidential and/or exempt from disclosure by law. If you are not the intended recipient or have received it in error, immediately notify the sender and delete it without copying it, disclosing it to anyone or making any use of it. AVISO DE CONFIDENCIALIDAD - Este mensaje es para el uso exclusivo del (de los) destinatario(s) indicados m?s arriba y puede tener informaci?n privilegiada, propietaria, confidencial y/o legalmente no divulgable. Si usted no es un destinatario de este mensaje o lo recibe por error, se le pide avisar inmediatamente al remitente y eliminar el mensaje sin copiarlo, divulgarlo o hacer cualquier otro uso del mismo. -----Original Message----- From: Sebastian Pipping [mailto:webmaster at hartwork.org] Sent: Sunday, August 03, 2008 10:22 AM To: Picard, Philippe Cc: expat-discuss at libexpat.org Subject: Re: [Expat-discuss] Need help on installing expat 2.0.1 with w3c-libwww Picard, Philippe wrote: > I am trying to upgrade my w3c-libwww package with a new XML parser. I am trying to install expat 2.0.1. I can compile expat on its own but I need help on how to interface it with w3c-libwww. > How do I replace the w3c-libwww xmlparse with expat? > I am running on Linux. Please be more precise. What exactly are you trying to do? Sebastian From yuki.latt at gmail.com Wed Aug 6 14:44:14 2008 From: yuki.latt at gmail.com (yuki latt) Date: Wed, 6 Aug 2008 21:44:14 +0900 Subject: [Expat-discuss] extracting value other than element and attribute In-Reply-To: References: Message-ID: Hello Nick, Thank you so much for your suggestion. I also realized that I am just cheating. I knew that I have to implement the way you said. But I dont know how I should handle XML_SetElementHandler and XML_SetCharacterDataHandler. The former one helped me to find a tag. But If I found a desired tag, I dont know how to go to XML_SetCharacterDataHandler to extract the value. Here is a piece of xml file I am working with. many tags here many tags here length width ..... many tags here length width ..... I'd to print as follows. Building ID="1" area = length and width Building ID="2" area = length and width At first, I used /expat/examples/elements.c file. In that elements.c file, there is XML_SetElementHandler(p, start, end); in main(). Inside static void XMLCALL start(void *data, const char *el, const char **attr), I made strcmp(el, "Building"). But I dont know how to go further to search for tag. Without searching for tag, I tried to find tag only. If found, I need to call a function to extract its value. But I cant make function call to XML_SetCharacterDataHandler from XMLCALL start. ( I am naive.) Then I tried it as follows. To extract element value, I added XML_SetCharacterDataHandler(p,elementText); in main(). Inside void XMLCALL elementText(void *userData,const char *xmlData,int len), I searched for tag inside it using strsr and strcpy to get element value after moving pointer a lot. I am really sorry to bother you. If you dont mind, could you please teach me? regards, yuki From yuki.latt at gmail.com Thu Aug 7 10:03:04 2008 From: yuki.latt at gmail.com (yuki latt) Date: Thu, 7 Aug 2008 17:03:04 +0900 Subject: [Expat-discuss] extracting value other than element and attribute In-Reply-To: References: Message-ID: Hello Nick, The problem is really solved. :D Putting "\0" at the end of the data passed into callback, I can take out desired element_value. without using strstr. Forgetting to do that made me take a lot of time to parse a file. Thank you so much! cheers, yuki From Mark.Williams at techop.co.uk Thu Aug 7 10:16:28 2008 From: Mark.Williams at techop.co.uk (Mark Williams) Date: Thu, 7 Aug 2008 09:16:28 +0100 Subject: [Expat-discuss] extracting value other than element andattribute In-Reply-To: References: Message-ID: Hello, > The problem is really solved. :D > > Putting "\0" at the end of the data passed into callback, I > can take out > desired element_value. without using strstr. Forgetting to do > that made me > take a lot of time to parse a file. I hope you are not modifying the data passed to your Character data handler callback (It is const XML_char * !). Remember these are not null terminated strings as you would normally expect programming in "C". You need to examine the length parameter to see how long the string is. Best Regards, Mark Williams, Tech OP ltd From yuki.latt at gmail.com Fri Aug 8 03:07:32 2008 From: yuki.latt at gmail.com (yuki latt) Date: Fri, 8 Aug 2008 10:07:32 +0900 Subject: [Expat-discuss] extracting value other than element andattribute In-Reply-To: References: Message-ID: Hello, Thank you for your reminding. I meant that I put "\0" to the temp_string copied from constant xml_data according to the len parameter. :) cheers, yuki On Thu, Aug 7, 2008 at 5:16 PM, Mark Williams wrote: > Hello, > > > The problem is really solved. :D > > > > Putting "\0" at the end of the data passed into callback, I > > can take out > > desired element_value. without using strstr. Forgetting to do > > that made me > > take a lot of time to parse a file. > > I hope you are not modifying the data passed to your Character > data handler callback (It is const XML_char * !). > > Remember these are not null terminated strings as you would normally > expect programming in "C". You need to examine the length parameter > to see how long the string is. > > Best Regards, > Mark Williams, Tech OP ltd > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss at libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > From nickmacd at gmail.com Fri Aug 8 20:41:41 2008 From: nickmacd at gmail.com (Nick MacDonald) Date: Fri, 8 Aug 2008 14:41:41 -0400 Subject: [Expat-discuss] A worthwhile but minimal eXpat example usage Message-ID: I have been using eXpat for a couple or more years, and I have been on this mailing list for much of that time. I notice that we seem to get asked some of the same questions over and over, and that for some reason the examples included with eXpat don't appear to be instructive enough. I wonder if I might supply the attached example program as a solution to those people who need a more fleshed out example. Its designed to find a pattern in the XML and extract a subset. Its deliberately kept simplified to avoid introducing too much complexity which would be distracting for a beginner. I would be perfectly happy to have this file included with eXpat or I would like a recommendation from others here on the list if there is something specific that would make it useful. I don't have my own page on which I can host it, but others may be willing to do so. Thanks, Nick -------------- next part -------------- A non-text attachment was scrubbed... Name: eXpatExample.c Type: application/octet-stream Size: 18387 bytes Desc: not available URL: From regis.st-gelais at laubrass.com Fri Aug 15 14:05:12 2008 From: regis.st-gelais at laubrass.com (=?iso-8859-1?Q?R=E9gis_St-Gelais_=28Laubrass=29?=) Date: Fri, 15 Aug 2008 08:05:12 -0400 Subject: [Expat-discuss] Test, please disregard Message-ID: <01b901c8fecf$2d17d0c0$6500a8c0@laubrasssag4> From Yin.Wei at autodesk.com Wed Aug 20 04:35:32 2008 From: Yin.Wei at autodesk.com (Yin Wei (Olivia)) Date: Tue, 19 Aug 2008 19:35:32 -0700 Subject: [Expat-discuss] Q: every .c needed? Message-ID: <3FF2397445743C47B05078B01C1D5E1A17AFE601EB@ADSK-NAMSG-01.MGDADSK.autodesk.com> Hi, I am using expat2.0 now and try to port to Linux. In expat.vcproj, actually, xmltok_impl.c and xmltok_ns.c were not added to the project. But I use a wildcard to match all the .c (*.c), so every .c can be compiled in gcc. Then found following errors: gcc -o /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.o -c -DNDEBUG -I/home/weiy/Desktop/ADP/external/expat /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanComment' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:128: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanDecl' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:175: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'checkPiTarget' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:220: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPi' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:282: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanCdataSection' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:302: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cdataSectionTok' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:380: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanEndTag' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:429: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanHexCharRef' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:461: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanCharRef' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:493: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanRef' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:523: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanAtts' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:682: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanLt' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:782: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'contentTok' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:881: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPercent' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:910: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPoundName' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:937: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanLit' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:969: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'prologTok' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1200: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'attributeValueTok' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1258: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'entityValueTok' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1368: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'isPublicId' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1428: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getAtts' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1521: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'charRefNumber' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1565: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'predefinedEntityName' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1619: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sameName' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1683: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nameMatchesAscii' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1696: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nameLength' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1723: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'skipS' /home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.c:1739: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'updatePosition' scons: *** [/home/weiy/Desktop/ADP/external/expat/2.0/expat/xmltok_impl.o] Error 1 if add the two .c files in VC9.0, errors will be: 1>xmltok_impl.c 1>..\..\expat\xmltok_impl.c(90) : error C2061: syntax error : identifier 'scanComment' 1>..\..\expat\xmltok_impl.c(90) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(90) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(128) : error C2061: syntax error : identifier 'scanDecl' 1>..\..\expat\xmltok_impl.c(128) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(128) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(175) : error C2061: syntax error : identifier 'checkPiTarget' 1>..\..\expat\xmltok_impl.c(175) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(175) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(220) : error C2061: syntax error : identifier 'scanPi' 1>..\..\expat\xmltok_impl.c(220) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(220) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(282) : error C2061: syntax error : identifier 'scanCdataSection' 1>..\..\expat\xmltok_impl.c(282) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(282) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(302) : error C2061: syntax error : identifier 'cdataSectionTok' 1>..\..\expat\xmltok_impl.c(302) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(302) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(380) : error C2061: syntax error : identifier 'scanEndTag' 1>..\..\expat\xmltok_impl.c(380) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(380) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(429) : error C2061: syntax error : identifier 'scanHexCharRef' 1>..\..\expat\xmltok_impl.c(429) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(429) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(461) : error C2061: syntax error : identifier 'scanCharRef' 1>..\..\expat\xmltok_impl.c(461) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(461) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(493) : error C2061: syntax error : identifier 'scanRef' 1>..\..\expat\xmltok_impl.c(493) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(493) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(523) : error C2061: syntax error : identifier 'scanAtts' 1>..\..\expat\xmltok_impl.c(523) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(523) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(682) : error C2061: syntax error : identifier 'scanLt' 1>..\..\expat\xmltok_impl.c(682) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(682) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(782) : error C2061: syntax error : identifier 'contentTok' 1>..\..\expat\xmltok_impl.c(782) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(782) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(881) : error C2061: syntax error : identifier 'scanPercent' 1>..\..\expat\xmltok_impl.c(881) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(881) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(910) : error C2061: syntax error : identifier 'scanPoundName' 1>..\..\expat\xmltok_impl.c(910) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(910) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(937) : error C2061: syntax error : identifier 'scanLit' 1>..\..\expat\xmltok_impl.c(937) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(937) : error C2059: syntax error : 'type' 1>..\..\expat\xmltok_impl.c(969) : error C2061: syntax error : identifier 'prologTok' 1>..\..\expat\xmltok_impl.c(969) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(969) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1200) : error C2061: syntax error : identifier 'attributeValueTok' 1>..\..\expat\xmltok_impl.c(1200) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1200) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1258) : error C2061: syntax error : identifier 'entityValueTok' 1>..\..\expat\xmltok_impl.c(1258) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1258) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1368) : error C2061: syntax error : identifier 'isPublicId' 1>..\..\expat\xmltok_impl.c(1368) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1368) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1428) : error C2061: syntax error : identifier 'getAtts' 1>..\..\expat\xmltok_impl.c(1428) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1428) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1521) : error C2061: syntax error : identifier 'charRefNumber' 1>..\..\expat\xmltok_impl.c(1521) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1521) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1565) : error C2061: syntax error : identifier 'predefinedEntityName' 1>..\..\expat\xmltok_impl.c(1565) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1565) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1619) : error C2061: syntax error : identifier 'sameName' 1>..\..\expat\xmltok_impl.c(1619) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1619) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1683) : error C2061: syntax error : identifier 'nameMatchesAscii' 1>..\..\expat\xmltok_impl.c(1683) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1683) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1696) : error C2061: syntax error : identifier 'nameLength' 1>..\..\expat\xmltok_impl.c(1696) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1696) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1723) : error C2061: syntax error : identifier 'skipS' 1>..\..\expat\xmltok_impl.c(1723) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1723) : error C2059: syntax error : '' 1>..\..\expat\xmltok_impl.c(1739) : error C2061: syntax error : identifier 'updatePosition' 1>..\..\expat\xmltok_impl.c(1739) : error C2059: syntax error : ';' 1>..\..\expat\xmltok_impl.c(1739) : error C2059: syntax error : '' 1>xmltok_ns.c 1>..\..\expat\xmltok_ns.c(1) : error C2220: warning treated as error - no 'object' file generated 1>..\..\expat\xmltok_ns.c(1) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int 1>..\..\expat\xmltok_ns.c(1) : error C2143: syntax error : missing '{' before '*' 1>..\..\expat\xmltok_ns.c(2) : error C2091: function returns function 1>..\..\expat\xmltok_ns.c(3) : warning C4131: 'NS' : uses old-style declarator 1>..\..\expat\xmltok_ns.c(3) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int 1>..\..\expat\xmltok_ns.c(4) : warning C4013: 'ns' undefined; assuming extern returning int 1>..\..\expat\xmltok_ns.c(4) : error C2065: 'internal_utf8_encoding' : undeclared identifier 1>..\..\expat\xmltok_ns.c(4) : error C2224: left of '.enc' must have struct/union type 1>..\..\expat\xmltok_ns.c(4) : warning C4033: 'NS' must return a value 1>..\..\expat\xmltok_ns.c(7) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int 1>..\..\expat\xmltok_ns.c(7) : error C2143: syntax error : missing '{' before '*' 1>..\..\expat\xmltok_ns.c(8) : error C2091: function returns function 1>..\..\expat\xmltok_ns.c(9) : warning C4131: 'NS' : uses old-style declarator 1>..\..\expat\xmltok_ns.c(9) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int 1>..\..\expat\xmltok_ns.c(9) : error C2084: function 'int *(__cdecl *NS())(void)' already has a body 1> ..\..\expat\xmltok_ns.c(2) : see previous definition of 'NS' 1>..\..\expat\xmltok_ns.c(17) : error C2065: 'internal_little2_encoding' : undeclared identifier 1>..\..\expat\xmltok_ns.c(17) : error C2224: left of '.enc' must have struct/union type 1>..\..\expat\xmltok_ns.c(18) : error C2065: 'internal_big2_encoding' : undeclared identifier 1>..\..\expat\xmltok_ns.c(18) : error C2224: left of '.enc' must have struct/union type 1>..\..\expat\xmltok_ns.c(18) : fatal error C1903: unable to recover from previous error(s); stopping compilation 1>Generating Code... 1>Build log was saved at "file://c:\P4\ADP\external\expat\2.0\build\vc9.0\obj\shared\debug\vc9.0\BuildLog.htm" 1> Expat XML Parser (2.0.0) - 97 error(s), 8 warning(s) What is the problem with the two files? Are they must be compiled? Looking forward to your help. Thanks, Olivia From nickmacd at gmail.com Wed Aug 20 08:32:11 2008 From: nickmacd at gmail.com (Nick MacDonald) Date: Wed, 20 Aug 2008 02:32:11 -0400 Subject: [Expat-discuss] Q: every .c needed? In-Reply-To: <3FF2397445743C47B05078B01C1D5E1A17AFE601EB@ADSK-NAMSG-01.MGDADSK.autodesk.com> References: <3FF2397445743C47B05078B01C1D5E1A17AFE601EB@ADSK-NAMSG-01.MGDADSK.autodesk.com> Message-ID: I'm not sure I understand your problem. eXpat compiles with gcc without any challenges on any recent version of Linux. Extract the .tar.gz file, run the the configure script and then type make... done in about a minute... I actually did this earlier today on Fedora 9 using expat 2.0.1 ... On Tue, Aug 19, 2008 at 10:35 PM, Yin Wei (Olivia) wrote: > Hi, > > I am using expat2.0 now and try to port to Linux. In expat.vcproj, actually, xmltok_impl.c and xmltok_ns.c were not added to the project. > But I use a wildcard to match all the .c (*.c), so every .c can be compiled in gcc. Then found following errors: From webmaster at hartwork.org Wed Aug 20 20:11:31 2008 From: webmaster at hartwork.org (Sebastian Pipping) Date: Wed, 20 Aug 2008 20:11:31 +0200 Subject: [Expat-discuss] Q: every .c needed? In-Reply-To: <3FF2397445743C47B05078B01C1D5E1A17AFE601EB@ADSK-NAMSG-01.MGDADSK.autodesk.com> References: <3FF2397445743C47B05078B01C1D5E1A17AFE601EB@ADSK-NAMSG-01.MGDADSK.autodesk.com> Message-ID: <48AC5E53.2040008@hartwork.org> Hello! This behavior changed from Expat v2.0.0. to v2.0.1. Some .c files were only meant to be included. To allow people to compile them nevertheless or to add them to a Visual Studio project we added #ifdef guards. Have a look at [1] to see this for . I recommend to update to Expat 2.0.1 if that's an option for you. Sebastian [1] http://expat.cvs.sourceforge.net/expat/expat/lib/xmltok_impl.c?r1=1.12&r2=1.13&pathrev=R_2_0_1