From marktt at excite.com Wed Jul 2 00:58:11 2003 From: marktt at excite.com (Mark Thomson) Date: Tue Jul 1 23:58:51 2003 Subject: [Expat-discuss] (no subject) Message-ID: <20030702035811.0E8CAB6E7@xmxpita.excite.com> >Expat relies on volunteer work, so if you find a nice way to do that, why not share it with the community? OK.. here's the function. I tested it only three times: (1) Parser is created without namespace processing (it returns 0-- no need to check if `parser->m_ns' is FALSE) (2) prefix == 0 (Returns default namespace or 0 if no default namespace was specified) (3) prefix != 0 (Get namespace corresponding to `prefix' or 0 if no namespace corresponds to the given prefix). I think I am not wrong about the following 2 points: - The default namespace is not stored in its own variable. Instead, it is stored as part of the element type name (i.e., there is no nul-terminated default namespace stored anywhere). - Every namespace in the hash table that contains the mappings has the namespaceSeparator character appended to it (it will be nul-terminated if namespaceSeparator == '\0'). Therefore, it is not possible to simply return a constant pointer because the namespace will not be nul-terminated (except when prefix != NULL and namespaceSeparator == '\0'). The function below returns the length of the uri. I think you don't want to included it as is. Here are two other possible candidates /* REALLOCs(*out) if *size is not enough to store the URI. Returns XML_ERROR_NO_MEMORY on error, XML_ERROR_NONE otherwise; */ enum XML_Error XML_GetNamespace(XML_Parser parser, const XML_Char *prefix, XML_Char **out, int *size); /* Copies the URI to `out', and returns `out' on success. If *size is not enough, store the required size in *size and return 0. */ XML_Char *XML_GetNamespace(XML_Parser parser, const XML_Char *prefix, XML_Char *out, int *size); This is not a patch. Simply add this to the xmlparse.c: /* uriLen must not == 0 */ /* pass 0 for prefix to get the current default namespace */ const XML_Char * XML_GetNamespace(XML_Parser parser, const XML_Char *prefix, int *uriLen) { DTD * const dtd = _dtd; const BINDING *b; if (!prefix) { b = dtd->defaultPrefix.binding; } else { PREFIX *p = (PREFIX *)lookup(&dtd->prefixes, prefix, sizeof(PREFIX)); if (p) b = p->binding; else b = 0; } if (b) { if (namespaceSeparator) *uriLen = b->uriLen - 1; else *uriLen = b->uriLen; return b->uri; } else *uriLen = 0; return 0; } and this to expat.h: XMLPARSEAPI(const XML_Char *) XML_GetNamespace(XML_Parser parser, const XML_Char *prefix, int *uriLen); BTW, I tried to give expat an illegal URI (h[]p://foo), it didn't complain. _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! From ranganath at kanrad.com Tue Jul 8 18:00:45 2003 From: ranganath at kanrad.com (Ranganath Bhupalam) Date: Tue Jul 8 09:36:31 2003 Subject: [Expat-discuss] Custom callback functions, depending on the attribute/element value ? Message-ID: I wud like to know if there is any means of registering custom callback functions with the SAX parser (such that, some predefined custom-function will be executed automatically, for certain element/attribute values.) Ranganath From w_k_henning at hotmail.com Wed Jul 9 00:37:16 2003 From: w_k_henning at hotmail.com (warren henning) Date: Tue Jul 8 19:37:50 2003 Subject: [Expat-discuss] Using the Win32 binary DLL? Message-ID: I'm using Visual C++ 6. I looked at the expat documentation (\Doc\reference.html) and it said "you may download the Win32 binary package that contains the "expat.h" include file and a pre-built DLL." This is precisely what I am attempting to do. I tried to build the example program, outline, using only the binary dll (libexpat.dll) by making a new project in a different directory with libexpat.directory in the same directory as the outline.c file i copied and pasted to the new directory. The copied C file was added to the project. Not knowing exactly what to do, I also added the libexpat.dll into the workspace so that it appeared in the file list. I don't know if that does anything at all. I attempted to buidl using the above configuration and got unresolved external symbol errors like so: dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_GetCurrentLineNumber dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_ErrorString dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_GetErrorCode etc etc. All the XML parser stuff. I looked at the error message documentation and it didn't give any indication of what could have caused the problem. I searched with Google to no avail. I zipped up the actual project directory with all the relevant files. It is a 245kb zip archive that can be downloaded at: http://wkh.daysbackwhen.com/dlltest.zip If someone wanted to download that, fix the problem(s), zip the files back up, and email the fixed project all zipped up as an email attachment, that'd be ideal. (However if someone wishes to offer written help instead that's also appreciated.) Any help is appreciated, thanks in advance. -Warren _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail From sachin at cse.iitb.ac.in Wed Jul 9 18:38:15 2003 From: sachin at cse.iitb.ac.in (Sachin Patil) Date: Wed Jul 9 08:10:08 2003 Subject: [Expat-discuss] Help needed In-Reply-To: Message-ID: Hi Could someone suggest where i could get examples illustrating the use of expat to parse a xml document? Thanks a lot Sachin From GSubhash at chn.cognizant.com Wed Jul 9 18:44:47 2003 From: GSubhash at chn.cognizant.com (Gururajan, Subhashini (Cognizant)) Date: Wed Jul 9 08:20:59 2003 Subject: [Expat-discuss] Help needed Message-ID: <14E2ECED6A08844980C5C5C9BDD247B1019B2B75@ctsinentsxua.cts.com> Hi, Try this link http://www.xml.com/pub/a/1999/09/expat/index.html?page=1 -Subha -----Original Message----- From: Sachin Patil [mailto:sachin@cse.iitb.ac.in] Sent: Wednesday, July 09, 2003 5:38 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Help needed Hi Could someone suggest where i could get examples illustrating the use of expat to parse a xml document? Thanks a lot Sachin _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss -------------- next part -------------- This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com From bhayes at dmsi.com Wed Jul 9 08:55:48 2003 From: bhayes at dmsi.com (Brad Hayes) Date: Wed Jul 9 08:55:55 2003 Subject: FW: [Expat-discuss] Help needed Message-ID: <2DFDF53DFBC2D3118A040006293834E802B984FE@net1.dmsinet.com> I can find all kinds of code snippets and examples of calling a particular function but I can't find an actual example of an xml file with an application that reads it and does something meaningful with the contents using expat. Maybe I've found them and not realized it. My real question is how the application logic is integrated into the project. Is it possible to keep it separate from the parser or does the business logic have to be applied within each callback function used. Brad Hayes DMSi - Omaha 402.330.6620 ext. 144 bhayes@dmsi.com -----Original Message----- From: Gururajan, Subhashini (Cognizant) [mailto:GSubhash@chn.cognizant.com] Sent: Wednesday, July 09, 2003 7:15 AM To: Sachin Patil; expat-discuss@libexpat.org Subject: RE: [Expat-discuss] Help needed Hi, Try this link http://www.xml.com/pub/a/1999/09/expat/index.html?page=1 -Subha -----Original Message----- From: Sachin Patil [mailto:sachin@cse.iitb.ac.in] Sent: Wednesday, July 09, 2003 5:38 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Help needed Hi Could someone suggest where i could get examples illustrating the use of expat to parse a xml document? Thanks a lot Sachin _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From GSubhash at chn.cognizant.com Wed Jul 9 19:58:57 2003 From: GSubhash at chn.cognizant.com (Gururajan, Subhashini (Cognizant)) Date: Wed Jul 9 09:26:35 2003 Subject: [Expat-discuss] Help needed Message-ID: <14E2ECED6A08844980C5C5C9BDD247B1019B2E9B@ctsinentsxua.cts.com> Your business logic need not be integrated with the callback function. What each call back function is going to give me is the parsed text, be it start tag or end tag or character tag. In your user defined function you will get this and apply your logic. Hope this make sense -subha -----Original Message----- From: Brad Hayes [mailto:bhayes@dmsi.com] Sent: Wednesday, July 09, 2003 6:26 PM To: 'expat-discuss@libexpat.org' Subject: FW: [Expat-discuss] Help needed I can find all kinds of code snippets and examples of calling a particular function but I can't find an actual example of an xml file with an application that reads it and does something meaningful with the contents using expat. Maybe I've found them and not realized it. My real question is how the application logic is integrated into the project. Is it possible to keep it separate from the parser or does the business logic have to be applied within each callback function used. Brad Hayes DMSi - Omaha 402.330.6620 ext. 144 bhayes@dmsi.com -----Original Message----- From: Gururajan, Subhashini (Cognizant) [mailto:GSubhash@chn.cognizant.com] Sent: Wednesday, July 09, 2003 7:15 AM To: Sachin Patil; expat-discuss@libexpat.org Subject: RE: [Expat-discuss] Help needed Hi, Try this link http://www.xml.com/pub/a/1999/09/expat/index.html?page=1 -Subha -----Original Message----- From: Sachin Patil [mailto:sachin@cse.iitb.ac.in] Sent: Wednesday, July 09, 2003 5:38 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Help needed Hi Could someone suggest where i could get examples illustrating the use of expat to parse a xml document? Thanks a lot Sachin _______________________________________________ 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 -------------- next part -------------- This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com From Greg.Martin at TELUS.COM Wed Jul 9 08:24:57 2003 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Wed Jul 9 10:32:15 2003 Subject: [Expat-discuss] Using the Win32 binary DLL? Message-ID: Did you add it to the Project->Settings->Link pane. If not select the General choice in the drop down list and add expat lib to the Object/library modules: text field. If the lib isn't in a system directory the lib path can be added by selecting the input drop down selection and adding the path to the appropriate text field. -----Original Message----- From: warren henning [mailto:w_k_henning@hotmail.com] Sent: Tuesday, July 08, 2003 5:37 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Using the Win32 binary DLL? I'm using Visual C++ 6. I looked at the expat documentation (\Doc\reference.html) and it said "you may download the Win32 binary package that contains the "expat.h" include file and a pre-built DLL." This is precisely what I am attempting to do. I tried to build the example program, outline, using only the binary dll (libexpat.dll) by making a new project in a different directory with libexpat.directory in the same directory as the outline.c file i copied and pasted to the new directory. The copied C file was added to the project. Not knowing exactly what to do, I also added the libexpat.dll into the workspace so that it appeared in the file list. I don't know if that does anything at all. I attempted to buidl using the above configuration and got unresolved external symbol errors like so: dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_GetCurrentLineNumber dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_ErrorString dlltest.obj : error LNK2001: unresolved external symbol __imp__XML_GetErrorCode etc etc. All the XML parser stuff. I looked at the error message documentation and it didn't give any indication of what could have caused the problem. I searched with Google to no avail. I zipped up the actual project directory with all the relevant files. It is a 245kb zip archive that can be downloaded at: http://wkh.daysbackwhen.com/dlltest.zip If someone wanted to download that, fix the problem(s), zip the files back up, and email the fixed project all zipped up as an email attachment, that'd be ideal. (However if someone wishes to offer written help instead that's also appreciated.) Any help is appreciated, thanks in advance. -Warren _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From ranganath at kanrad.com Thu Jul 10 10:59:55 2003 From: ranganath at kanrad.com (Ranganath Bhupalam) Date: Thu Jul 10 00:34:24 2003 Subject: [Expat-discuss] Custom callback functions, depending on the attribute/element value ? Message-ID: I wud like to know if there is any means of registering custom callback functions with the expat (SAX) parser (such that, some predefined custom-function will be executed automatically, based on the element/attribute value.) Ranganath From Greg.Martin at TELUS.COM Thu Jul 10 11:01:30 2003 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Thu Jul 10 13:03:17 2003 Subject: [Expat-discuss] Custom callback functions, depending on the attribute/element value ? Message-ID: Expat isn't a SAX parser is it? Anyway, with expat you register an element handler and it gets called for each element it encounters. You would put the code in there to handle specific elements. If you want to "genericize" your element handler I'd suggest using function pointers in C or a variation of a Factory pattern for C++. -----Original Message----- From: Ranganath Bhupalam [mailto:ranganath@kanrad.com] Sent: Wednesday, July 09, 2003 10:30 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] Custom callback functions, depending on the attribute/element value ? I wud like to know if there is any means of registering custom callback functions with the expat (SAX) parser (such that, some predefined custom-function will be executed automatically, based on the element/attribute value.) Ranganath _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From wang.liang at neusoft.com Mon Jul 14 12:17:00 2003 From: wang.liang at neusoft.com (wangl) Date: Mon Jul 14 01:27:25 2003 Subject: [Expat-discuss] why expat-1.95.6 can NOT parse parameter entity ? Message-ID: <002101c349b6$641db590$9b02010a@unit1xxxjwsqjd> Both expat-1.2 and expat-1.95.6 can NOT parse parameter entity. Who can tell me what reason is it for ? Just like the follow sample can NOT pass expat parser: ]> wang.liang@neusoft.com From rolf at pointsman.de Mon Jul 14 12:33:44 2003 From: rolf at pointsman.de (rolf@pointsman.de) Date: Mon Jul 14 05:38:07 2003 Subject: [Expat-discuss] why expat-1.95.6 can NOT parse parameter entity ? In-Reply-To: <002101c349b6$641db590$9b02010a@unit1xxxjwsqjd> Message-ID: <20030714093347.3810466404@pointsman.pointsman.de> On 14 Jul, wangl wrote: > Both expat-1.2 and expat-1.95.6 can NOT parse parameter entity. Who can tell me what reason is it for ? > > Just like the follow sample can NOT pass expat parser: > > > > > > ]> > Expat reports an xml error and is right with this. Your document is not wellformed. See http://www.w3.org/TR/REC-xml#wfc-PEinInternalSubset for the reason. rolf From prashant at enflex.net Mon Jul 14 13:51:15 2003 From: prashant at enflex.net (Prashant) Date: Tue Jul 15 08:22:54 2003 Subject: [Expat-discuss] running expat examples Message-ID: <000c01c34a41$493add30$ab478ed8@prashant> Hi, I did an default configuration for the Expat parser on Linux. I am also able to compile the c program elements.c. However when i run the executable with an XML file as argument on the command line, the program stucks in an infinite loop. Can some one telll me what i am doing wrong??? Also, I dont have vc++ for windows. So is there some way that i can use the parser on windows. thanks, Prashant From blew at medis.nl Wed Jul 16 18:11:51 2003 From: blew at medis.nl (Baldur van Lew) Date: Wed Jul 16 11:13:25 2003 Subject: [Expat-discuss] Where to put the license text? Message-ID: This sounds like a dumb question - but where should I but the Expat license text in my product? The product has a gui with an "about box" but the text is a bit large for that. Is the help a suitable place? What do other developers do? By the way the product itself simply uses expat to read some application specific data stored in XML. Cheers, Baldur van Lew Software Engineer Medis medical imaging systems bv excellence in medical imaging P.O. Box 384, 2300 AJ Leiden, The Netherlands Tel: +31 71 5223244 Fax: +31 71 5215617 E-mail:blew@medis.nl Website: www.medis.nl IMPORTANT *The information in this e-mail is intended only for the addressee and might contain confidential information. Any review, distribution, dissemination or other use of this information by anyone other than the intended recipient, is prohibited. If you have received this e-mail in error, please forward it to: info@medis.nl. Please then delete the original and any copies of it. *Opening any content attached to this email implies running the risk of damaging your computer system due to the possible presence of viruses. Every reasonable precaution has been taken to minimize that risk. Liability for any damage sustained as a result of software viruses cannot be accepted. In general it is advisable to run your own virus checks before opening this or any other attachment. This e-mail message has been swept for the presence of known computer viruses. From Greg.Martin at TELUS.COM Wed Jul 16 10:53:12 2003 From: Greg.Martin at TELUS.COM (Greg Martin) Date: Wed Jul 16 12:53:51 2003 Subject: [Expat-discuss] running expat examples Message-ID: If it's not too long prehaps you should cut&paste the XML file that causes the problem into an e-mail so there is something more for people to go on. As for windows, if you installed cygnus' cygwin you could probably do a UNIX build on a MSWin platform but I don't imagine there's any reason not to use the prebuilt MSWin binaries with other compilers. -----Original Message----- From: Prashant [mailto:prashant@enflex.net] Sent: Monday, July 14, 2003 1:51 PM To: expat-discuss@libexpat.org Subject: [Expat-discuss] running expat examples Hi, I did an default configuration for the Expat parser on Linux. I am also able to compile the c program elements.c. However when i run the executable with an XML file as argument on the command line, the program stucks in an infinite loop. Can some one telll me what i am doing wrong??? Also, I dont have vc++ for windows. So is there some way that i can use the parser on windows. thanks, Prashant _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss From mba2000 at ioplex.com Wed Jul 16 23:44:08 2003 From: mba2000 at ioplex.com (Michael B Allen) Date: Wed Jul 16 22:44:28 2003 Subject: [Expat-discuss] Building on Windows Message-ID: <65368.199.43.32.22.1058409848.squirrel@miallen.com> Where can I get the static libraries for building against expat on Windows? If it's in the exe I can't download those from within my firewall. Is there an alternative location for zips? I tried the 1.95.4 zip but it only had a dll. I tried putting the dll in winnt\system32 but I get unresolved expat symbols. Can I build against the dll or do I need static libs? If so where can I get them? If I can build against the dll what cl flags do I use? Thanks, Mike From xcross at us.ibm.com Thu Jul 17 12:04:49 2003 From: xcross at us.ibm.com (Chris Cross) Date: Thu Jul 17 11:03:48 2003 Subject: [Expat-discuss] encoding Message-ID: I'm a little confused about how encoding support works in expat: 1. Does expat support parsing UTF-8 and UTF-16 no matter how it is compiled? 2. XML_UNICODE and XML_UNICODE_WCHAR_T controls the definition of type XML_Char in the expat API's. Does this only determine the *ouput* encoding? 3. XML_ParserCreate takes an optional character encoding parameter. Does that tell it what the *input* encoding will be? How does it work if the argument is NULL? thanks, chris Chris Cross IBM Boca Raton xcross@us.ibm.com voice 561.862.2102 t/l 975.2102 fax 561.862.3922 From karl at waclawek.net Thu Jul 17 12:23:30 2003 From: karl at waclawek.net (Karl Waclawek) Date: Thu Jul 17 11:23:41 2003 Subject: [Expat-discuss] encoding References: Message-ID: <003301c34c77$60d3fa70$9e539696@citkwaclaww2k> > I'm a little confused about how encoding support works in expat: > > 1. Does expat support parsing UTF-8 and UTF-16 no matter how it is > compiled? Yes. And if you supply an appriate UnknownEncodingHandler it can process almost any reasonable encoding. > 2. XML_UNICODE and XML_UNICODE_WCHAR_T controls the definition of type > XML_Char in the expat API's. Does this only determine the *ouput* encoding? Exactly. Id determines how Expat passes information to the call-back handlers. > 3. XML_ParserCreate takes an optional character encoding parameter. Does > that tell it what the *input* encoding will be? Yes. Useful when the document has no XML declaration, but is not encoded in UTF-8 (which is the default). > How does it work if the argument is NULL? Expat tries to determine the encoding from the XML document. If the document has a correct XML declaration you will not need to specify an encoding. Karl From w_k_henning at hotmail.com Wed Jul 23 18:18:56 2003 From: w_k_henning at hotmail.com (warren henning) Date: Wed Jul 23 13:19:29 2003 Subject: [Expat-discuss] Parser that uses Expat "stops working" in Win32/MFC program? Message-ID: I wrote a program which uses the Expat parser in C to run in a console (DOS) environment. I changed that code around a little bit so that I could call the important functions from other parts of my Windows program (I'm using Visual C++ 6 SP5). Basically what happens is a function that my program calls does all the Expat-based parsing and returns a data structure with all the information my program needs. To call the function you don't have to know how Expat works (that was kind of the point). But the parser seems to not be filling out the fields of the data structure. The same code worked under DOS just fine, even when I adapted it so that a test file with a short main() function just called the function in the code I wrote to do all the parsing. Now I figured problems might arise from trying to use C code with C++, but (the filenames for my code are rss_process.c and rss_process.h) as long as I include 'extern C { #include "rss_process.h"' in the C++ file that wants to call the C functions it seems to work fine. I added debugging statements to the important functions in my parser's code (the start() and end() callback functions that are provided to Expat) -- essentially they output data to a file. I added statements to simply output "in function (whatever)" to see if the functions were even called and apparently they aren't because the statements that should have appeared in the output file are non-existent. What could cause working code (the parser code was working fine under DOS) to break under Win32/MFC/C++ environment? I've been trying to get this to work for a few days and I'm pretty much stumped. If anyone wants to see the actual code I can put it on the Internet. Thanks in advance! -Warren _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From stu728 at yahoo.com Fri Jul 25 09:25:25 2003 From: stu728 at yahoo.com (Stuart Powers) Date: Fri Jul 25 11:25:58 2003 Subject: [Expat-discuss] Expat treating ISO-8859-1 char strangely? Message-ID: <20030725152525.24824.qmail@web40706.mail.yahoo.com> Hi, we're new to this mailling list, and we were wondering if anyone here could help us with a problem we're having. Our XML file (with encoding set to ISO-8859-1) contains the following string: "Kickin’ it Dash style" The apostrophe, we're pretty sure, is a character from the ISO-8859-1 character set. (We got this string for testing by copying and pasting from http://www.zeldman.com/daily/0703b.shtml#anil .) We're using XML::DOM (which uses XML::DOM::Parser, which supposedly uses Expat) to parse this XML file, and when we send the parsed data to a browser (via HTTP), it comes out like this: " KickinÂ’ it Dash style" That is how Mozilla displays it when it is set to read character encoding ISO-8859-1. When set to read UTF-8, it simply displays "Kickin#146; it Dash style". We would sort of understand it if Expat simply took our ISO-8859-1 character and copied it directly (byte by byte), or if it somehow converted it to UTF-8 and we got a UTF-8 character, but it appears that it's doing neither - it's sending us bytes which don't seem to be a valid character in either character set. If anyone can shed some light on what's happening, give us some advice, or point us to a place with some more information that might help, that will be greatly appreciated. If you don't think that Expat is the source of the problem here, please let us know that also. Thanks for any help you can give us. =) - John and Stu --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software From fdrake at acm.org Fri Jul 25 12:44:52 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Fri Jul 25 11:46:55 2003 Subject: [Expat-discuss] Expat treating ISO-8859-1 char strangely? In-Reply-To: <20030725152525.24824.qmail@web40706.mail.yahoo.com> References: <20030725152525.24824.qmail@web40706.mail.yahoo.com> Message-ID: <16161.20596.711616.99735@grendel.zope.com> Stuart Powers writes: > Hi, we're new to this mailling list, and we were wondering if anyone here could help us with a problem we're having. > > Our XML file (with encoding set to ISO-8859-1) contains the following string: > > "Kickin? it Dash style" > > The apostrophe, we're pretty sure, is a character from the > ISO-8859-1 character set. (We got this string for testing by > copying and pasting from > http://www.zeldman.com/daily/0703b.shtml#anil .) > > We're using XML::DOM (which uses XML::DOM::Parser, which supposedly uses Expat) to parse this XML file, and when we send the parsed data to a browser (via HTTP), it comes out like this: > > " Kickin?? it Dash style" Other than the space prepended at the begining, that's the UTF-8 I'd expect. > That is how Mozilla displays it when it is set to read character > encoding ISO-8859-1. When set to read UTF-8, it simply displays > "Kickin#146; it Dash style". I don't know why Mozilla would display it like that. That's a Mozilla issue. > We would sort of understand it if Expat simply took our ISO-8859-1 > character and copied it directly (byte by byte), or if it somehow > converted it to UTF-8 and we got a UTF-8 character, but it appears > that it's doing neither - it's sending us bytes which don't seem to > be a valid character in either character set. This is definately a display thing. ISO-8859-1 character 0222 (0x92) converts to the UTF-8 sequence 0302 0222 (0xc2 0x92). So Expat is doing the right thing. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From karl at waclawek.net Fri Jul 25 13:46:24 2003 From: karl at waclawek.net (Karl Waclawek) Date: Fri Jul 25 12:46:34 2003 Subject: [Expat-discuss] Data misalignment on PocketPC platform References: <3150232E9918D311A30500104BCC6496045C7ACA@AVMAIL> Message-ID: <002a01c352cc$49468430$9e539696@citkwaclaww2k> Thanks for the update. CC'ed to the list, since this may be valuable information for others. ----- Original Message ----- From: "George Dabrowski" To: "Karl Waclawek" Sent: Friday, July 25, 2003 12:07 PM Subject: RE: [Expat-discuss] Data misalignment on PocketPC platform > Thanks all the same. > Turns out the problem lies with the CE 3.0 compiler, it fails if > optimizations are on for the lookup function. I threw a couple of pragmas > around that function and now everything works fine. > I understand that the problem does not occur with the CE 4.0 compiler... > > -----Original Message----- > From: Karl Waclawek [mailto:karl@waclawek.net] > Sent: Thursday, July 24, 2003 5:36 p > To: George Dabrowski > Subject: Re: [Expat-discuss] Data misalignment on PocketPC platform > > > > ----- Original Message ----- > From: "George Dabrowski" > To: > Sent: Thursday, July 24, 2003 5:33 PM > Subject: [Expat-discuss] Data misalignment on PocketPC platform > > > > Hello,Karl, > > > > I came across this thread, [Expat-discuss] Data misalignment on PocketPC > > platform, > > on mail.libexpat.org. Although it is over a year old I am experiencing > the > > same problem > > even though I am using expat ver. 1.95.5. > > Have you got any recommendations as to what I could do to fix the > alignment > > issue? > > I have to admit I know nothing about building on PocketPC. > The old issue may have been related to XML_UNICODE not > working, but this has since been fixed. At this point > I am really lost as to what could cause your problem. > > Karl > From bartelsl at bellsouth.net Sun Jul 27 18:21:25 2003 From: bartelsl at bellsouth.net (bartelsl@bellsouth.net) Date: Mon Jul 28 08:46:42 2003 Subject: [Expat-discuss] Reading DTDs Message-ID: <000801c3548d$6be900e0$6101a8c0@funkytown> Hello all, I'm working on some code that creates binary encodings of XML data. I don't really need any validation as such but I need element and attribute lists to be parsed. I just started working with expat and I've made a few modifications to the elements.c example that work correctly. I thought that I could get the results I wanted by doing something like the following: static void DTDElements(void *userData, const XML_Char *name, XML_Content *model) { printf("Element Name: %s\n", model->name); puts(name); printf("Number of Children: %d\n", model->numchildren); } and then in main: XML_SetElementDeclHandler(parser, DTDElements); problem is that now the program does absolutely nothing. Do errors are generated. The program ends and it doesn't look like any events are generated. Any ideas? Thanks, Brent