From dcroft10 at yahoo.com Thu Dec 4 11:57:17 2008 From: dcroft10 at yahoo.com (Debbie Croft) Date: Thu, 4 Dec 2008 02:57:17 -0800 (PST) Subject: [Expat-discuss] "INVALID_TOKEN" error on processing XML document with Unicode characters Message-ID: <892722.58394.qm@web110702.mail.gq1.yahoo.com> We have some XML documents that contain Unicode characters (foreign names). The documents all have a UTF-16 header. However, the parser throws an "INVALID_TOKEN" error when we try to parse them. Any ideas how we can get this working? From a.lichtenberger at ligosworld.com Tue Dec 9 23:04:16 2008 From: a.lichtenberger at ligosworld.com (Andreas Lichtenberger) Date: Tue, 09 Dec 2008 23:04:16 +0100 Subject: [Expat-discuss] Parser sending only one charector References: 000001c5ddf0$1a08a1b0$ac02a8c0@Ajit Message-ID: <493EEB60.6070307@ligosworld.com> Hi Paul, sorry for disturbing you, but i found this very old discussion about expat parser on symbian. I use the c expat on s60 3rd and i am facing the exactly same problem: http://mail.python.org/pipermail/expat-discuss/2005-October/001921.html In fact i have seen a lot of your works on expat with symbian. So i hope that you are maybe able to help me. I am porting a very big project to symbian and i will need c expat for that not syexpat. With the best regards, Andi From james at interlockex.com Wed Dec 10 17:17:28 2008 From: james at interlockex.com (James Renton) Date: Wed, 10 Dec 2008 10:17:28 -0600 (CST) Subject: [Expat-discuss] FW: OverExecuting characterDataHandler() Message-ID: <1228925848.v2.mailanyonewebmail-234616@fuse114> I am using expat to quickly extract and parse an audio stream encoded in base64. This way I can include all kinds of useful meta-data as attributes of each chunk. The source of my audio produces 8000 ? 32000 bytes per second. I just produced a working prototype and noticed that calls to my characterDataHandler() (set by using XML_SetCharacterDataHandler()) are occurring as follows: 1. All bytes up to but excluding the first/next carriage return (in my case 80) 2. Carriage return (single byte) 3. Repeat (1) I am pushing this data off-process and streaming it to various endpoints using sockets (not decoding). This is producing a VERY LARGE quantity of function calls to my handler which is not optimum. It would be much better if at least 1-15 kilobytes of data were passed to the characterDataHandler at a time rather. My questions: 1. How exactly does the character data parsing in expat work? Some insight in this regard might answer all of my questions. 2. Is the behavior of the libraries calls to the handler configurable in any way (possibly using #define?s, custom builds etc?)? 3. Is there any other way to decrease the number of function calls in this case? I appreciate any feedback. Thank you, James Beverly, MA From karl at waclawek.net Wed Dec 10 18:44:42 2008 From: karl at waclawek.net (Karl Waclawek) Date: Wed, 10 Dec 2008 12:44:42 -0500 Subject: [Expat-discuss] FW: OverExecuting characterDataHandler() In-Reply-To: <1228925848.v2.mailanyonewebmail-234616@fuse114> References: <1228925848.v2.mailanyonewebmail-234616@fuse114> Message-ID: <4940000A.8000909@waclawek.net> James Renton wrote: > I am using expat to quickly extract and parse an audio stream encoded in > base64. This way I can include all kinds of useful meta-data as > attributes of each chunk. > You mean the stream is XML, and the chunks are base64? I would be surprised of Expat parsed base64 directly. > The source of my audio produces 8000 ? 32000 bytes per second. I just > produced a working prototype and noticed that calls to my > characterDataHandler() (set by using XML_SetCharacterDataHandler()) are > occurring as follows: > 1. All bytes up to but excluding the first/next carriage return (in my > case 80) > 2. Carriage return (single byte) > 3. Repeat (1) > > I am pushing this data off-process and streaming it to various endpoints > using sockets (not decoding). This is producing a VERY LARGE quantity of > function calls to my handler which is not optimum. It would be much > better if at least 1-15 kilobytes of data were passed to the > characterDataHandler at a time rather. My questions: > 1. How exactly does the character data parsing in expat work? Some > insight in this regard might answer all of my questions. > 2. Is the behavior of the libraries calls to the handler configurable > in any way (possibly using #define?s, custom builds etc?)? > 3. Is there any other way to decrease the number of function calls in > this case? > > The call-back logic would be hard to change, but you can always accumulate character data in a buffer and make your other calls based on having accumulated enough data to warrant a network call. Karl From haiyang at broadcom.com Tue Dec 23 04:34:24 2008 From: haiyang at broadcom.com (Hendry (Hai) Yang) Date: Mon, 22 Dec 2008 19:34:24 -0800 Subject: [Expat-discuss] _msize does not have equivalent function in Nucleus Message-ID: <416D5CF71C9F2C438F7049770CDC2AE72504096B07@IRVEXCHCCR02.corp.ad.broadcom.com> Hi all, A standard realization of realloc function in Microsoft VC as below: void* realloc(void* buf, size_t len) { void* newBuf ; // Get rid of degenerate cases if (buf == 0) return malloc(len); if (len == 0) { free(buf); return 0; } // Need to move memory, acquire new chunk newBuf = malloc(len); if (!newBuf ) return 0; // Move data to the new location memcpy(newBuf , buf, min(_msize(buf), len)); free(buf); return newBuf ; } I need to port this function to Nucleus(RTOS) but there is no function equivalent to _msize which return the size of a buffer. Any advice? Does anyone know how Microsoft return the size of a buffer and why RTOS can not? Thanks Hai