From gye_jin at hotmail.com Thu Dec 4 22:15:00 2003 From: gye_jin at hotmail.com (=?ks_c_5601-1987?B?vsiw6MH4?=) Date: Fri Dec 5 09:54:26 2003 Subject: [Expat-discuss] How to use XML_ParserReset for re-enty ? Message-ID: Hi all, I'm a new user of expat XML parser, when I'm trying to parser twice (re-entry), I think it is right to use XML_ParserReset. but, there's an error reported like "junk after document element".. I don't sure to use XML_ParserReset function. the following is my outline.c example int main(int argc, char *argv[]) { XML_Parser p = XML_ParserCreate(NULL); if (! p) { fprintf(stderr, "Couldn't allocate memory for parser\n"); exit(-1); } XML_SetElementHandler(p, start, end); for (;;) { int done; int len; len = fread(Buff, 1, BUFFSIZE, stdin); if (ferror(stdin)) { fprintf(stderr, "Read error\n"); exit(-1); } done = feof(stdin); if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); XML_ParserReset(p,NULL); // if there is error, Clean up the memory structures so that it may be used again. //exit(-1); } if (done) break; } return 0; } From karl at waclawek.net Tue Dec 9 00:34:45 2003 From: karl at waclawek.net (Karl Waclawek) Date: Tue Dec 9 00:30:58 2003 Subject: [Expat-discuss] XML_GetBuffer References: Message-ID: <000b01c3be16$27cb2ad0$0207a8c0@karl> > > Yes, just use XML_Parse(). However, this will still copy the data > > to Expat's internal buffer - which Expat creates with XML_GetBuffer(). > > Performance-wise this does not gain you anything. > > However, if you build Expat with XML_CONTEXT_BYTES undefined then > > it will parse directly from your buffer, unless there were unparsed > > data left from the previous buffer - in which case it will still copy > > all data internally (and this would be the more likely case). > > > > How can there be unparsed data left from the previous buffer ?. Does > the parser treat the data unparsed when the remaining bytes at the end > of a buffer is not enough to generate an event ?. Yes, if Expat reaches the end of a buffer and there are some data that are insufficient to generate an event, they are copied over since they would get lost otherwise. > > One more question : How can I undefine XML_CONTEXT_BYTES ?. > I commented following line in winconfig.h > > #define XML_CONTEXT_BYTES 1024 > > But still the parser working in the same way. If it works fine > XML_GetInputContext should return NULL ? Am I correct ?. Yes - as one can see from the source. Make sure you do a full re-build. > > Btw, the best approach performance-wise would be if your > > application could use a buffer created with XML_GetBuffer(). > > That would avoid double copying. > > If we do this does the buffer belong to the application ?. I mean > memory freeing ?. I suppose not. Correct, this memory is managed by Expat. > Does XML_ParserReset free those buffers ?. I don't remember, but it should not concern you, as you don't have to manage that memory. Karl From susantha at opensource.lk Mon Dec 8 23:56:13 2003 From: susantha at opensource.lk (Susantha Kumara) Date: Tue Dec 9 02:04:54 2003 Subject: [Expat-discuss] XML_GetBuffer In-Reply-To: <002101c3af6e$ef49cb40$9e539696@citkwaclaww2k> Message-ID: Hi Karl, > -----Original Message----- > From: Karl Waclawek [mailto:karl@waclawek.net] > Sent: Thursday, November 20, 2003 8:02 PM > To: damitha@opensource.lk; expat-discuss@libexpat.org > Cc: susantha@opensource.lk > Subject: Re: [Expat-discuss] XML_GetBuffer > > > > If someone give me answers to the following two questions it is > > greatly appreciated. > > > > > > My first question is, > > My application is receiving buffers of varying length and I need > > to parse them as I receive them. Is it possible to parse these > > buffers directly without calling XML_GetBuffer function to get > > a buffer from expat?. > > Yes, just use XML_Parse(). However, this will still copy the data > to Expat's internal buffer - which Expat creates with XML_GetBuffer(). > Performance-wise this does not gain you anything. > However, if you build Expat with XML_CONTEXT_BYTES undefined then > it will parse directly from your buffer, unless there were unparsed > data left from the previous buffer - in which case it will still copy > all data internally (and this would be the more likely case). > How can there be unparsed data left from the previous buffer ?. Does the parser treat the data unparsed when the remaining bytes at the end of a buffer is not enough to generate an event ?. One more question : How can I undefine XML_CONTEXT_BYTES ?. I commented following line in winconfig.h #define XML_CONTEXT_BYTES 1024 But still the parser working in the same way. If it works fine XML_GetInputContext should return NULL ? Am I correct ?. > > > My second question is, > > > > If the answer to the first question is yes, will the expat > > delete my buffer?. > > > > I actually tested these and got the answer to the > > first 'yes' and to the second 'no'. Just asking to confirm that. > > Confirmed. > > Btw, the best approach performance-wise would be if your > application could use a buffer created with XML_GetBuffer(). > That would avoid double copying. If we do this does the buffer belong to the application ?. I mean memory freeing ?. I suppose not. Does XML_ParserReset free those buffers ?. > > Karl > Thanks, Susantha. From llk at lampreynetworks.com Mon Dec 15 12:59:45 2003 From: llk at lampreynetworks.com (Dr. K.) Date: Mon Dec 15 15:52:17 2003 Subject: [Expat-discuss] help build expatpp on linux Message-ID: <000601c3c335$3ac751d0$577fa8c0@Genoa> Hi expat experts, I have an application that uses expat to parse xml files and produce an output that is viewable in a web browser. The application is written in C++ and works on Windows. I am, however, having problems getting expatpp (the C++ wrapper I am using) to build on linux. Is there someone out there who has had experience building expatpp and can help me out? I am not able to even compile the sample code that's included with the wrapper - the compiler seems to have trouble with expatpp header files, which I think is rather odd. I did see a thread closely related to this but in that thread, people were looking for a C++ wrapper. Please respond privately to ndurwe@yahoo.com as I would not wish to clutter the list with something that people may not be too interested in discussing. Thanks. -- ndurwe@yahoo.com From fdrake at acm.org Mon Dec 15 15:56:01 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Mon Dec 15 15:56:11 2003 Subject: [Expat-discuss] help build expatpp on linux In-Reply-To: <000601c3c335$3ac751d0$577fa8c0@Genoa> References: <000601c3c335$3ac751d0$577fa8c0@Genoa> Message-ID: <16350.8161.894352.726001@sftp.fdrake.net> Dr. K. writes: > Please respond privately to ndurwe@yahoo.com as I would not wish to > clutter the list with something that people may not be too interested in > discussing. This sounds on-topic for the list. This list isn't about C++ programming, but using Expat from languages other than C is interesting for many here, including Karl and myself. We each use Expat primarily from non-C languages. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From allan.saywitz at pb.com Tue Dec 16 11:16:52 2003 From: allan.saywitz at pb.com (allan.saywitz@pb.com) Date: Tue Dec 16 11:18:40 2003 Subject: [Expat-discuss] help build expatpp on linux In-Reply-To: <16350.8161.894352.726001@sftp.fdrake.net> Message-ID: Skipped content of type multipart/related-------------- next part -------------- A non-text attachment was scrubbed... Name: XMLExpatParser.h Type: application/octet-stream Size: 5920 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/XMLExpatParser-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cpp Type: application/octet-stream Size: 954 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/main-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: TestExpatParser.cpp Type: application/octet-stream Size: 870 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/TestExpatParser-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: TestExpatParser.h Type: application/octet-stream Size: 664 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/TestExpatParser-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: XMLExpatParser.cpp Type: application/octet-stream Size: 7020 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/XMLExpatParser-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: car.xml Type: application/octet-stream Size: 219 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031216/f4949373/car-0001.obj From llk at lampreynetworks.com Tue Dec 16 11:57:57 2003 From: llk at lampreynetworks.com (Dr. K.) Date: Tue Dec 16 11:56:13 2003 Subject: [Expat-discuss] help build expatpp on linux In-Reply-To: Message-ID: <000601c3c3f5$c2491880$577fa8c0@Genoa> Allan, I decided to write my own C++ wrapper as well because I didn't want to waste time trying to figure out the problems with expatpp. Your wrapper will hopefully help me improve mine which is patterned on expatpp and ulxr_expatwrap. Thanks for your help! -- dr k > -----Original Message----- > From: expat-discuss-bounces@libexpat.org > [mailto:expat-discuss-bounces@libexpat.org] On Behalf Of > allan.saywitz@pb.com > Sent: Tuesday, December 16, 2003 11:17 AM > To: expat-discuss@libexpat.org > Subject: Re: [Expat-discuss] help build expatpp on linux > > > I looked at expatpp, but had similar problems so I wrote a > very light c++ > expat wrapper. It seems to work pretty good. Doesn't > cover everything, > but its easily expandable. > > > > (See attached file: XMLExpatParser.h)(See attached file: > main.cpp)(See attached file: TestExpatParser.cpp)(See > attached file: TestExpatParser.h) (See attached file: > XMLExpatParser.cpp)(See attached file: car.xml) > > > thanks > > allan > From karl at waclawek.net Tue Dec 16 12:18:29 2003 From: karl at waclawek.net (Karl Waclawek) Date: Tue Dec 16 12:18:35 2003 Subject: [Expat-discuss] help build expatpp on linux References: <000601c3c3f5$c2491880$577fa8c0@Genoa> Message-ID: <003e01c3c3f8$a02b8be0$9e539696@citkwaclaww2k> > Allan, > > I decided to write my own C++ wrapper as well because I didn't want to > waste time trying to figure out the problems with expatpp. > > Your wrapper will hopefully help me improve mine which is patterned on > expatpp and ulxr_expatwrap. Have you had a look at the other C++ wrappers on the Expat home page? http://www.libexpat.org/#wrappers Karl From llk at lampreynetworks.com Wed Dec 17 21:05:55 2003 From: llk at lampreynetworks.com (Dr. K.) Date: Wed Dec 17 21:04:11 2003 Subject: [Expat-discuss] Dllimport warnings In-Reply-To: <000601c3c3f5$c2491880$577fa8c0@Genoa> Message-ID: <000c01c3c50b$79521340$577fa8c0@Genoa> I am a bit puzzled by these warnings because I checked and found a CVS log which seems says they should have been removed. I just downloaded a version (October 15?) which is spewing zillions of these dllimport warnings. The earlier version I had didn't have XML_Status and other enums so I figured an update was in order. Is there anything I can do to suppress them and/or is there a newer version of expat that really does get rid of these things? Thanks. -- dr k From karl at waclawek.net Wed Dec 17 21:58:25 2003 From: karl at waclawek.net (Karl Waclawek) Date: Wed Dec 17 21:54:10 2003 Subject: [Expat-discuss] Dllimport warnings References: <000c01c3c50b$79521340$577fa8c0@Genoa> Message-ID: <001b01c3c512$ce9e2620$0207a8c0@karl> > I am a bit puzzled by these warnings because I checked and found a CVS > log which seems says they should have been removed. I just downloaded a > version (October 15?) which is spewing zillions of these dllimport > warnings. The earlier version I had didn't have XML_Status and other > enums so I figured an update was in order. > > Is there anything I can do to suppress them and/or is there a newer > version of expat that really does get rid of these things? Details please. Platform, compiler, what are you trying to do, etc... Karl From ONSIGHT at t-online.de Tue Dec 23 14:28:46 2003 From: ONSIGHT at t-online.de (martin moessner) Date: Tue Dec 23 14:44:24 2003 Subject: [Expat-discuss] Strange parser problem needs help ... Message-ID: <200312232028.46920.martin.moessner@bertholdtech.com> Hi to all, merry christmas ... I wrote an app on an embedded linux system which parses xml as follows ... The app reads the xml data from a file then it attaches an new report and writes it again. Unidentified error happened . . . Unidentified error happened Unidentified error happened Unidentified error happened The problem is that after running the app a few times a part of the information between the xml tags get lost. And I don't know why. Here are some code fragments ... void ErorLogCharHandler (void *data, const XML_Char *s, int len) { LoggerData* pd = (LoggerData *)data; if(pd->flg) { fprintf(stderr,"COntent ->%s\n",s); if(strcmp (tag, "report") == 0) { fprintf((*pd->poErrorLogger).a_pflFileTmp,"<%s %s=\"%d\">\n", tag, "id", pd->count); } if(strcmp (tag, "time") == 0) { fprintf((*pd->poErrorLogger).a_pflFileTmp,"<%s>",tag); fprintf((*pd->poErrorLogger).a_pflFileTmp,"%s", ((*pd->poErrorLogger).getTagContent(s,len)).c_str()); fprintf((*pd->poErrorLogger).a_pflFileTmp,"\n",tag); } if(strcmp (tag, "msg") == 0) { fprintf((*pd->poErrorLogger).a_pflFileTmp,"<%s>",tag); fprintf((*pd->poErrorLogger).a_pflFileTmp,"%s", ((*pd->poErrorLogger).getTagContent(s,len)).c_str()); fprintf((*pd->poErrorLogger).a_pflFileTmp,"\n",tag); fprintf((*pd->poErrorLogger).a_pflFileTmp,"\n"); } pd->flg = false; } } string c_ErrorLogger::getTagContent(const XML_Char *s,int len) { string strg; int i; if(s == NULL) { return strg; } for (i= 0; i < len; i++) { strg +=*s++; } return strg; } I receive the text by a handler which should be no problem. Each time information get lost the 'len' var changed too. Also the 's' reduces it's content. The app runs as cpp application. Any ideas? Thanks in advance Martin From sekretarz at dukato.net Tue Dec 23 15:11:55 2003 From: sekretarz at dukato.net (sekretarz@dukato.net) Date: Tue Dec 23 15:10:02 2003 Subject: [Expat-discuss] DOM support in expat Message-ID: <2986.192.168.1.41.1072210315.squirrel@dukato.net> Hello Is DOM support planned in expat? Karol 'sekretarz' Wojtaszek From royclem at ev1.net Tue Dec 23 16:58:39 2003 From: royclem at ev1.net (Roy Clemmons) Date: Tue Dec 23 16:57:49 2003 Subject: [Expat-discuss] expat access violation Message-ID: <01e201c3c99f$ec7ca2c0$92d128d8@royclem> Greetings, I have installed expat-1.95.7 into Cygwin 1.5.5-1 using the Cygwin setup utility. In /usr/lib I have: libexpat.a libexpat.dll.a libexpat.la and in /usr/bin, I have cygexpat-0.dll. When I compile and link the following program, I get a segmentation fault. What am I doing wrong...could expat be installed incorrectly? Note: I did not make expat. I simply installed it from the Cygwin setup utility. gcc -o test test.cc -lexpat #include #include int main() { XML_ParserCreate(NULL); return 0; } Exception: STATUS_ACCESS_VIOLATION at eip=00000000 eax=00000000 ebx=00000004 ecx=610CB16C edx=00000002 esi=00000000 edi=00000000 ebp=0022FE98 esp=0022FE7C program=C:\cygwin\expat\test.exe cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args End of stack trace Thank you, Roy From regis.st-gelais at laubrass.com Tue Dec 23 18:52:47 2003 From: regis.st-gelais at laubrass.com (=?iso-8859-2?Q?R=E9gis_St-Gelais?=) Date: Tue Dec 23 18:53:33 2003 Subject: [Expat-discuss] DOM support in expat References: <2986.192.168.1.41.1072210315.squirrel@dukato.net> Message-ID: <043901c3c9af$de6ab220$647ba8c0@regis> Not according to this: http://expat.sourceforge.net/dev/roadmap.html R?gis St-Gelais, P. Eng. / ing. Director, Research & Development / Directeur, Recherche et D?veloppement Laubrass Inc. Because time is important Parce que le temps est important Toll free / Sans frais 866-UMT-PALM (866-868-7256) Local Phone / T?l?phone 418-699-PALM (418-699-7256) Fax / T?l?copie 418-699-PALM (418-699-7256) Email / Courriel regis.st-gelais@laubrass.com support@laubrass.com Web Site / Site Web www.laubrass.com ----- Original Message ----- From: sekretarz@dukato.net To: expat-discuss@libexpat.org Sent: Tuesday, December 23, 2003 3:11 PM Subject: [Expat-discuss] DOM support in expat Hello Is DOM support planned in expat? Karol 'sekretarz' Wojtaszek _______________________________________________ Expat-discuss mailing list Expat-discuss@libexpat.org http://mail.libexpat.org/mailman/listinfo/expat-discuss -------------- next part -------------- A non-text attachment was scrubbed... Name: Logo Laubrass Signature.gif Type: image/gif Size: 3026 bytes Desc: not available Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20031223/85f256f1/LogoLaubrassSignature.gif From regis.st-gelais at laubrass.com Tue Dec 23 19:35:52 2003 From: regis.st-gelais at laubrass.com (=?iso-8859-2?Q?R=E9gis_St-Gelais?=) Date: Tue Dec 23 19:38:04 2003 Subject: [Expat-discuss] DOM support in expat References: <2986.192.168.1.41.1072210315.squirrel@dukato.net> Message-ID: <045801c3c9b5$e3167830$647ba8c0@regis> (Sorry I responded in HTML) >Hello > >Is DOM support planned in expat? > >Karol 'sekretarz' Wojtaszek > Not according to this: http://expat.sourceforge.net/dev/roadmap.html R?gis From karl at waclawek.net Tue Dec 23 20:03:29 2003 From: karl at waclawek.net (Karl Waclawek) Date: Tue Dec 23 19:58:54 2003 Subject: [Expat-discuss] Strange parser problem needs help ... References: <200312232028.46920.martin.moessner@bertholdtech.com> Message-ID: <001501c3c9b9$bec59b60$0207a8c0@karl> > string c_ErrorLogger::getTagContent(const XML_Char *s,int len) > { > string strg; > int i; > if(s == NULL) > { > return strg; > } > for (i= 0; i < len; i++) > { > strg +=*s++; > } > return strg; > } > > I receive the text by a handler which should be no problem. Each time > information get lost the 'len' var changed too. Also the 's' reduces it's > content. The app runs as cpp application. I haven't looked closely at your code (no time), but have you considered that the character data handler may be called multiple times to report all text in a contiguous block? This is documented behaviour. Karl From royclem at ev1.net Wed Dec 24 06:42:03 2003 From: royclem at ev1.net (Roy Clemmons) Date: Wed Dec 24 06:41:22 2003 Subject: [Expat-discuss] Re: Expat seq fault Message-ID: <02e101c3ca12$f3f5a510$92d128d8@royclem> > When I compile and link the following program, I get a > segmentation fault. What am I doing wrong...could expat > be installed incorrectly? I configured and made expat according to the instructions in its distribution and now it works! I wonder why the cygwin version did not? Roy From royclem at ev1.net Wed Dec 24 16:45:14 2003 From: royclem at ev1.net (Roy Clemmons) Date: Wed Dec 24 16:44:32 2003 Subject: [Expat-discuss] xmlwf Message-ID: <04a601c3ca67$37a94bf0$92d128d8@royclem> Greetings, When making expat-1.95.7 in cygwin, I receive the following errors: /bin/bash ./libtool --silent --mode=link gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_ CONFIG_H -I./lib -I. -o xmlwf/xmlwf xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/readfilemap.o libexpat.la ./libtool: line 4841: .libs/lt-xmlwf/xmlwf.c: No such file or directory ./libtool: line 4857: .libs/lt-xmlwf/xmlwf.c: No such file or directory ./libtool: line 4916: .libs/lt-xmlwf/xmlwf.c: No such file or directory ./libtool: line 4920: .libs/lt-xmlwf/xmlwf.c: No such file or directory ./libtool: line 4930: .libs/lt-xmlwf/xmlwf.c: No such file or directory ./libtool: line 4934: .libs/lt-xmlwf/xmlwf.c: No such file or directory gcc: .libs/lt-xmlwf/xmlwf.c: No such file or directory gcc: no input files Why am I receiving these errors? Thanks, Roy From gp at familiehaase.de Sun Dec 28 16:53:29 2003 From: gp at familiehaase.de (Gerrit P. Haase) Date: Sun Dec 28 16:46:17 2003 Subject: [Expat-discuss] Re: xmlwf In-Reply-To: <04a601c3ca67$37a94bf0$92d128d8@royclem> References: <04a601c3ca67$37a94bf0$92d128d8@royclem> Message-ID: <1501677.20031228225329@familiehaase.de> Hallo Roy, Am Mittwoch, 24. Dezember 2003 um 22:45 schriebst du: > Greetings, > When making expat-1.95.7 in cygwin, I receive the following errors: > /bin/bash ./libtool --silent --mode=link > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -DHAVE_EXPAT_ > CONFIG_H -I./lib -I. -o xmlwf/xmlwf xmlwf/xmlwf.o xmlwf/xmlfile.o > xmlwf/codepage.o xmlwf/readfilemap.o libexpat.la > ./libtool: line 4841: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > ./libtool: line 4857: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > ./libtool: line 4916: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > ./libtool: line 4920: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > ./libtool: line 4930: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > ./libtool: line 4934: .libs/lt-xmlwf/xmlwf.c: No such file or > directory > gcc: .libs/lt-xmlwf/xmlwf.c: No such file or directory > gcc: no input files > Why am I receiving these errors? Expat doesn't use automake. The Cygwin libtool uses a special hack to avoid recompilation of executables during the `make install' step. I use a patch to work around this 'bug' in Cygwin libtool. Apply this to ltmain.sh and copy it over the Expat libtool. $ diff -u ltmain.sh~ ltmain.sh --- ltmain.sh~ 2003-08-18 07:36:11.001000000 +0200 +++ ltmain.sh 2003-10-30 00:13:30.104377600 +0100 @@ -4481,8 +4481,10 @@ esac case $host in *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${output}.c` - cwrapper=`$echo ${output}.exe` + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource=`$echo ${output_path}/${objdir}/lt-${output_name}.c` + cwrapper=`$echo ${output_path}/${output_name}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 @@ -4813,7 +4815,7 @@ # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource + $run ln -f ${output_path}/${objdir}/${output_name}.exe ${cwrapper} ;; esac $rm $output Gerrit -- =^..^= From romamik at mail.ru Tue Dec 30 11:26:23 2003 From: romamik at mail.ru (Roman Miklashesvky) Date: Tue Dec 30 11:29:51 2003 Subject: [Expat-discuss] Actual encoding used Message-ID: <17809.031230@mail.ru> How can I what encoding was used. I can look in XMLDecl, but encoding name sometimes is not enough. I.e. 'utf-16' can meen both utf-16le or utf-16be. From karl at waclawek.net Tue Dec 30 12:34:11 2003 From: karl at waclawek.net (Karl Waclawek) Date: Tue Dec 30 12:29:11 2003 Subject: [Expat-discuss] Actual encoding used References: <17809.031230@mail.ru> Message-ID: <000f01c3cefb$231ea570$0207a8c0@karl> > How can I what encoding was used. I can look in XMLDecl, but encoding > name sometimes is not enough. I.e. 'utf-16' can meen both utf-16le or > utf-16be. If it is UTF-16 the first character must be a byte order mark. This will tell you which one it is, LE or BE. Karl