From qu.duan@qwest.com Mon Apr 8 15:09:12 2002 From: qu.duan@qwest.com (Duan, Qu X) Date: Mon Apr 8 14:09:12 2002 Subject: [Expat-checkins] could not get value from get "atts" in start XML_StarElementHand ler Message-ID: <49F78F5E3F07D511818200508B5C785104288BAC@BALNTEX001.qwest.net> Hi, I am new to expat. When running the example of outline.c and elements.c , I could not get any element value except the name from array "atts" passwed in by start handler. Where is wrong? I am using expat-1.95.2, installed on Solaris 8 for learning. Thanks River From fdrake@users.sourceforge.net Mon Apr 15 20:13:05 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 15 19:13:05 2002 Subject: [Expat-checkins] CVS: expat expat.spec,1.3,1.4 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv5099 Modified Files: expat.spec Log Message: Fix name of the "bin" directory; was missing the default $prefix component. Index: expat.spec =================================================================== RCS file: /cvsroot/expat/expat/expat.spec,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** expat.spec 25 Jul 2001 20:14:13 -0000 1.3 --- expat.spec 16 Apr 2002 02:12:20 -0000 1.4 *************** *** 25,29 **** %install rm -rf $RPM_BUILD_ROOT ! mkdir -p $RPM_BUILD_ROOT/bin mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT/usr/include --- 25,29 ---- %install rm -rf $RPM_BUILD_ROOT ! mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT/usr/include From fdrake@users.sourceforge.net Mon Apr 15 21:25:04 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 15 20:25:04 2002 Subject: [Expat-checkins] CVS: expat/xmlwf wfcheck.c,1.15,NONE wfcheck.h,1.8,NONE wfcheckmessage.c,1.4,NONE Message-ID: Update of /cvsroot/expat/expat/xmlwf In directory usw-pr-cvs1:/tmp/cvs-serv18092/xmlwf Removed Files: wfcheck.c wfcheck.h wfcheckmessage.c Log Message: Remove files that are no longer used. This closes SF patch #488187. --- wfcheck.c DELETED --- --- wfcheck.h DELETED --- --- wfcheckmessage.c DELETED --- From fdrake@users.sourceforge.net Mon Apr 15 21:25:05 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 15 20:25:05 2002 Subject: [Expat-checkins] CVS: expat MANIFEST,1.9,1.10 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv18092 Modified Files: MANIFEST Log Message: Remove files that are no longer used. This closes SF patch #488187. Index: MANIFEST =================================================================== RCS file: /cvsroot/expat/expat/MANIFEST,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MANIFEST 7 Dec 2001 10:20:51 -0000 1.9 --- MANIFEST 16 Apr 2002 03:24:48 -0000 1.10 *************** *** 41,47 **** xmlwf/readfilemap.c xmlwf/unixfilemap.c - xmlwf/wfcheck.c - xmlwf/wfcheck.h - xmlwf/wfcheckmessage.c xmlwf/win32filemap.c xmlwf/xmlfile.c --- 41,44 ---- From fdrake@users.sourceforge.net Fri Apr 19 11:40:38 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 10:40:38 2002 Subject: [Expat-checkins] CVS: expat/xmlwf xmlwf.c,1.56,1.57 Message-ID: Update of /cvsroot/expat/expat/xmlwf In directory usw-pr-cvs1:/tmp/cvs-serv22136 Modified Files: xmlwf.c Log Message: Wrap some long lines. Index: xmlwf.c =================================================================== RCS file: /cvsroot/expat/expat/xmlwf/xmlwf.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** xmlwf.c 5 Dec 2001 16:30:31 -0000 1.56 --- xmlwf.c 19 Apr 2002 16:19:33 -0000 1.57 *************** *** 112,116 **** } ! static void startElement(void *userData, const XML_Char *name, const XML_Char **atts) { int nAtts; --- 112,117 ---- } ! static void startElement(void *userData, const XML_Char *name, ! const XML_Char **atts) { int nAtts; *************** *** 155,159 **** } ! static void startElementNS(void *userData, const XML_Char *name, const XML_Char **atts) { int nAtts; --- 156,161 ---- } ! static void startElementNS(void *userData, const XML_Char *name, ! const XML_Char **atts) { int nAtts; *************** *** 221,225 **** #ifndef W3C14N ! static void processingInstruction(void *userData, const XML_Char *target, const XML_Char *data) { FILE *fp = userData; --- 223,228 ---- #ifndef W3C14N ! static void processingInstruction(void *userData, const XML_Char *target, ! const XML_Char *data) { FILE *fp = userData; *************** *** 240,244 **** } ! static void defaultStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) { XML_DefaultCurrent(parser); --- 243,248 ---- } ! static void defaultStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { XML_DefaultCurrent(parser); *************** *** 250,254 **** } ! static void defaultProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) { XML_DefaultCurrent(parser); --- 254,260 ---- } ! static void defaultProcessingInstruction(XML_Parser parser, ! const XML_Char *target, ! const XML_Char *data) { XML_DefaultCurrent(parser); *************** *** 259,263 **** } ! static void nopStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) { } --- 265,270 ---- } ! static void nopStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { } *************** *** 267,271 **** } ! static void nopProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) { } --- 274,279 ---- } ! static void nopProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { } *************** *** 305,309 **** static ! void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) { FILE *fp = XML_GetUserData(parser); --- 313,318 ---- static ! void metaStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { FILE *fp = XML_GetUserData(parser); *************** *** 347,351 **** static ! void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) { FILE *fp = XML_GetUserData(parser); --- 356,361 ---- static ! void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { FILE *fp = XML_GetUserData(parser); *************** *** 577,581 **** void usage(const XML_Char *prog) { ! ftprintf(stderr, T("usage: %s [-n] [-p] [-r] [-s] [-w] [-x] [-d output-dir] [-e encoding] file ...\n"), prog); exit(1); } --- 587,593 ---- void usage(const XML_Char *prog) { ! ftprintf(stderr, ! T("usage: %s [-n] [-p] [-r] [-s] [-w] [-x] [-d output-dir] " ! "[-e encoding] file ...\n"), prog); exit(1); } *************** *** 712,716 **** file = tcsrchr(file, T('\\')) + 1; #endif ! outName = malloc((tcslen(outputDir) + tcslen(file) + 2) * sizeof(XML_Char)); tcscpy(outName, outputDir); tcscat(outName, T("/")); --- 724,729 ---- file = tcsrchr(file, T('\\')) + 1; #endif ! outName = malloc((tcslen(outputDir) + tcslen(file) + 2) ! * sizeof(XML_Char)); tcscpy(outName, outputDir); tcscat(outName, T("/")); *************** *** 732,741 **** XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); XML_SetCommentHandler(parser, metaComment); ! XML_SetCdataSectionHandler(parser, metaStartCdataSection, metaEndCdataSection); XML_SetCharacterDataHandler(parser, metaCharacterData); ! XML_SetDoctypeDeclHandler(parser, metaStartDoctypeDecl, metaEndDoctypeDecl); XML_SetEntityDeclHandler(parser, metaEntityDecl); XML_SetNotationDeclHandler(parser, metaNotationDecl); ! XML_SetNamespaceDeclHandler(parser, metaStartNamespaceDecl, metaEndNamespaceDecl); metaStartDocument(parser); break; --- 745,757 ---- XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); XML_SetCommentHandler(parser, metaComment); ! XML_SetCdataSectionHandler(parser, metaStartCdataSection, ! metaEndCdataSection); XML_SetCharacterDataHandler(parser, metaCharacterData); ! XML_SetDoctypeDeclHandler(parser, metaStartDoctypeDecl, ! metaEndDoctypeDecl); XML_SetEntityDeclHandler(parser, metaEntityDecl); XML_SetNotationDeclHandler(parser, metaNotationDecl); ! XML_SetNamespaceDeclHandler(parser, metaStartNamespaceDecl, ! metaEndNamespaceDecl); metaStartDocument(parser); break; *************** *** 745,749 **** XML_SetElementHandler(parser, defaultStartElement, defaultEndElement); XML_SetCharacterDataHandler(parser, defaultCharacterData); ! XML_SetProcessingInstructionHandler(parser, defaultProcessingInstruction); break; default: --- 761,766 ---- XML_SetElementHandler(parser, defaultStartElement, defaultEndElement); XML_SetCharacterDataHandler(parser, defaultCharacterData); ! XML_SetProcessingInstructionHandler(parser, ! defaultProcessingInstruction); break; default: From fdrake@users.sourceforge.net Fri Apr 19 12:26:01 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 11:26:01 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.6,1.7 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv10976/tests Modified Files: runtests.c Log Message: basic_setup(): Remove bogus assumption that all tests would use US-ASCII data; let Expat determine the proper encoding from the XML source text. Added several tests relating to supposed mis-interpretation of Latin-1; these show that Expat (at least in the CVS version) is properly decoding the Latin-1 text and generating the proper UTF-8 output. This closes SF bug #491986, #514281. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** runtests.c 18 Nov 2001 13:56:01 -0000 1.6 --- runtests.c 19 Apr 2002 18:25:07 -0000 1.7 *************** *** 3,6 **** --- 3,7 ---- #include #include + #include #include "expat.h" *************** *** 13,17 **** basic_setup(void) { ! parser = XML_ParserCreate("us-ascii"); if (parser == NULL) fail("Parser not created."); --- 14,18 ---- basic_setup(void) { ! parser = XML_ParserCreate(NULL); if (parser == NULL) fail("Parser not created."); *************** *** 30,43 **** */ static void ! xml_failure(void) { ! char buffer[256]; ! sprintf(buffer, "%s (line %d, offset %d)", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), ! XML_GetCurrentColumnNumber(parser)); fail(buffer); } START_TEST(test_nul_byte) { --- 31,47 ---- */ static void ! _xml_failure(const char *file, int line) { ! char buffer[1024]; ! sprintf(buffer, "%s (line %d, offset %d)\n reported from %s, line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), ! XML_GetCurrentColumnNumber(parser), ! file, line); fail(buffer); } + #define xml_failure() _xml_failure(__FILE__, __LINE__) + START_TEST(test_nul_byte) { *************** *** 112,115 **** --- 116,217 ---- + typedef struct + { + int count; + XML_Char data[1024]; + } CharData; + + static void + accumulate_characters(void *userData, const XML_Char *s, int len) + { + CharData *storage = (CharData *)userData; + if (len + storage->count < sizeof(storage->data)) { + memcpy(storage->data + storage->count, s, len); + storage->count += len; + } + } + + static void + check_characters(CharData *storage, XML_Char *expected) + { + char buffer[1024]; + int len = strlen(expected); + if (len != storage->count) { + sprintf(buffer, "wrong number of data characters: got %d, expected %d", + storage->count, len); + fail(buffer); + return; + } + if (memcmp(expected, storage->data, len) != 0) + fail("got bad data bytes"); + } + + static void + run_character_check(XML_Char *text, XML_Char *expected) + { + CharData storage; + storage.count = 0; + XML_SetUserData(parser, &storage); + XML_SetCharacterDataHandler(parser, accumulate_characters); + if (!XML_Parse(parser, text, strlen(text), 1)) + xml_failure(); + check_characters(&storage, expected); + } + + /* Regression test for SF bug #491986. */ + START_TEST(test_danish_latin1) + { + char *text = + "\n" + "Jørgen æøåÆØÅ"; + run_character_check(text, + "J\xC3\xB8rgen \xC3\xA6\xC3\xB8\xC3\xA5\xC3\x86\xC3\x98\xC3\x85"); + } + END_TEST + /* End regression test for SF bug #491986. */ + + + /* Regression test for SF bug #514281. */ + START_TEST(test_french_charref_hexidecimal) + { + char *text = + "\n" + "éèàçêÈ"; + run_character_check(text, + "\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88"); + } + END_TEST + + START_TEST(test_french_charref_decimal) + { + char *text = + "\n" + "éèàçêÈ"; + run_character_check(text, + "\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88"); + } + END_TEST + + START_TEST(test_french_latin1) + { + char *text = + "\n" + "\xE9\xE8\xE0\xE7\xEa\xC8"; + run_character_check(text, + "\xC3\xA9\xC3\xA8\xC3\xA0\xC3\xA7\xC3\xAA\xC3\x88"); + } + END_TEST + + START_TEST(test_french_utf8) + { + char *text = + "\n" + "\xC3\xA9"; + run_character_check(text, "\xC3\xA9"); + } + END_TEST + /* End regression test for SF bug #514281. */ + + /* Helpers used by the following test; this checks any "attr" and "refs" * attributes to make sure whitespace has been normalized. *************** *** 236,239 **** --- 338,348 ---- tcase_add_test(tc_chars, test_bom_utf16_be); tcase_add_test(tc_chars, test_bom_utf16_le); + /* Regression test for SF bug #491986. */ + tcase_add_test(tc_chars, test_danish_latin1); + /* Regression test for SF bug #514281. */ + tcase_add_test(tc_attrs, test_french_charref_hexidecimal); + tcase_add_test(tc_attrs, test_french_charref_decimal); + tcase_add_test(tc_attrs, test_french_latin1); + tcase_add_test(tc_attrs, test_french_utf8); suite_add_tcase(s, tc_attrs); From fdrake@users.sourceforge.net Fri Apr 19 12:51:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 11:51:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.7,1.8 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv20366/tests Modified Files: runtests.c Log Message: Add the new tests to the right TCase object. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** runtests.c 19 Apr 2002 18:25:07 -0000 1.7 --- runtests.c 19 Apr 2002 18:50:26 -0000 1.8 *************** *** 341,348 **** tcase_add_test(tc_chars, test_danish_latin1); /* Regression test for SF bug #514281. */ ! tcase_add_test(tc_attrs, test_french_charref_hexidecimal); ! tcase_add_test(tc_attrs, test_french_charref_decimal); ! tcase_add_test(tc_attrs, test_french_latin1); ! tcase_add_test(tc_attrs, test_french_utf8); suite_add_tcase(s, tc_attrs); --- 341,348 ---- tcase_add_test(tc_chars, test_danish_latin1); /* Regression test for SF bug #514281. */ ! tcase_add_test(tc_chars, test_french_charref_hexidecimal); ! tcase_add_test(tc_chars, test_french_charref_decimal); ! tcase_add_test(tc_chars, test_french_latin1); ! tcase_add_test(tc_chars, test_french_utf8); suite_add_tcase(s, tc_attrs); From fdrake@users.sourceforge.net Fri Apr 19 12:58:03 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 11:58:03 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.21,1.22 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv22970 Modified Files: Makefile.in Log Message: Make the sample applications depend on the Expat library. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Makefile.in 7 Dec 2001 10:19:30 -0000 1.21 --- Makefile.in 19 Apr 2002 18:57:24 -0000 1.22 *************** *** 137,149 **** examples/elements.o: examples/elements.c ! examples/elements: examples/elements.o $(LINK_EXE) $< lib/$(LIBRARY) examples/outline.o: examples/outline.c ! examples/outline: examples/outline.o $(LINK_EXE) $< lib/$(LIBRARY) tests/runtests.o: tests/runtests.c ! tests/runtests: tests/runtests.o $(LINK_EXE) $< lib/$(LIBRARY) --- 137,149 ---- examples/elements.o: examples/elements.c ! examples/elements: examples/elements.o lib/$(LIBRARY) $(LINK_EXE) $< lib/$(LIBRARY) examples/outline.o: examples/outline.c ! examples/outline: examples/outline.o lib/$(LIBRARY) $(LINK_EXE) $< lib/$(LIBRARY) tests/runtests.o: tests/runtests.c ! tests/runtests: tests/runtests.o lib/$(LIBRARY) $(LINK_EXE) $< lib/$(LIBRARY) From fdrake@users.sourceforge.net Fri Apr 19 13:27:10 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 12:27:10 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.8,1.9 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv1426/tests Modified Files: runtests.c Log Message: Add a test that checks that illegal UTF-8 sequences are not allowed to pass when we are using UTF-8 encoding. This closes SF bug #477667. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** runtests.c 19 Apr 2002 18:50:26 -0000 1.8 --- runtests.c 19 Apr 2002 19:18:35 -0000 1.9 *************** *** 213,216 **** --- 213,240 ---- /* End regression test for SF bug #514281. */ + /* Regression test for SF bug #477667. + * This test assures that any 8-bit character followed by a 7-bit + * character will not be mistakenly interpreted as a valid UTF-8 + * sequence. + */ + START_TEST(test_illegal_utf8) + { + char text[100]; + int i; + + for (i = 128; i <= 255; ++i) { + sprintf(text, "%ccd", i); + if (XML_Parse(parser, text, strlen(text), 1)) { + sprintf(text, + "expected token error for '%c'(ordinal %d) in UTF-8 text", + i, i); + fail(text); + } + else if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN) + xml_failure(); + } + } + END_TEST + /* Helpers used by the following test; this checks any "attr" and "refs" *************** *** 338,341 **** --- 362,366 ---- tcase_add_test(tc_chars, test_bom_utf16_be); tcase_add_test(tc_chars, test_bom_utf16_le); + tcase_add_test(tc_chars, test_illegal_utf8); /* Regression test for SF bug #491986. */ tcase_add_test(tc_chars, test_danish_latin1); From fdrake@users.sourceforge.net Fri Apr 19 14:53:06 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 13:53:06 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.25,1.26 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv16286/lib Modified Files: xmlparse.c Log Message: Check in SF patch #476929: Fix XML_SetReturnNSTriplet(). This is slightly modified from the submitted patch to ensure a variable is never used uninitialized. Patch contributed by Karl Waclawek. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** xmlparse.c 16 Nov 2001 20:57:30 -0000 1.25 --- xmlparse.c 19 Apr 2002 20:52:39 -0000 1.26 *************** *** 1766,1775 **** --tagLevel; if (endElementHandler && tag->name.str) { - if (tag->name.localPart) { - XML_Char *to = (XML_Char *)tag->name.str + tag->name.uriLen; - const XML_Char *from = tag->name.localPart; - while ((*to++ = *from++) != 0) - ; - } endElementHandler(handlerArg, tag->name.str); } --- 1766,1769 ---- *************** *** 1921,1926 **** --- 1915,1922 ---- const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; + int prefixLen = 0; int i; int n; + XML_Char *uri; int nPrefixes = 0; BINDING *binding; *************** *** 2125,2128 **** --- 2121,2131 ---- } else + localPart = NULL; + if (ns && ns_triplets && binding->prefix->name) { + for (prefixLen = 0; binding->prefix->name[prefixLen++];) + ; + n += prefixLen; + } + else return XML_ERROR_NONE; tagNamePtr->localPart = localPart; *************** *** 2133,2137 **** if (n > binding->uriAlloc) { TAG *p; ! XML_Char *uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY; --- 2136,2140 ---- if (n > binding->uriAlloc) { TAG *p; ! uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY; *************** *** 2144,2148 **** binding->uri = uri; } ! memcpy(binding->uri + binding->uriLen, localPart, i * sizeof(XML_Char)); tagNamePtr->str = binding->uri; return XML_ERROR_NONE; --- 2147,2157 ---- binding->uri = uri; } ! uri = binding->uri + binding->uriLen; ! memcpy(uri, localPart, i * sizeof(XML_Char)); ! if (prefixLen) { ! uri = uri + (i - 1); ! if (namespaceSeparator) { *(uri) = namespaceSeparator; } ! memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char)); ! } tagNamePtr->str = binding->uri; return XML_ERROR_NONE; From fdrake@users.sourceforge.net Fri Apr 19 15:00:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 14:00:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.9,1.10 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv20546/tests Modified Files: runtests.c Log Message: Added a test for SF bug #231864. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** runtests.c 19 Apr 2002 19:18:35 -0000 1.9 --- runtests.c 19 Apr 2002 20:59:01 -0000 1.10 *************** *** 347,350 **** --- 347,422 ---- + /* + * Namespaces tests. + */ + + static void + namespace_setup(void) + { + parser = XML_ParserCreateNS(NULL, ' '); + if (parser == NULL) + fail("Parser not created."); + } + + static void + namespace_teardown(void) + { + basic_teardown(); + } + + /* Check that an element name and attribute name match the expected values. + * The expected values are passed as an array reference of string pointers + * provided as the userData argument; the first is the expected + * element name, and the second is the expected attribute name. + */ + static void + triplet_start_checker(void *userData, const XML_Char *name, + const XML_Char **atts) + { + char **elemstr = (char **)userData; + char buffer[1024]; + if (strcmp(elemstr[0], name) != 0) { + sprintf(buffer, "unexpected start string: '%s'", name); + fail(buffer); + } + if (strcmp(elemstr[1], atts[0]) != 0) { + sprintf(buffer, "unexpected attribute string: '%s'", atts[0]); + fail(buffer); + } + } + + /* Check that the element name passed to the end-element handler matches + * the expected value. The expected value is passed as the first element + * in an array of strings passed as the userData argument. + */ + static void + triplet_end_checker(void *userData, const XML_Char *name) + { + char **elemstr = (char **)userData; + if (strcmp(elemstr[0], name) != 0) { + char buffer[1024]; + sprintf(buffer, "unexpected end string: '%s'", name); + fail(buffer); + } + } + + START_TEST(test_return_ns_triplet) + { + char *text = + ""; + char *elemstr[] = { + "http://expat.sf.net/ e foo", + "http://expat.sf.net/ a bar" + }; + XML_SetReturnNSTriplet(parser, 1); + XML_SetUserData(parser, elemstr); + XML_SetElementHandler(parser, triplet_start_checker, triplet_end_checker); + if (!XML_Parse(parser, text, strlen(text), 1)) + xml_failure(); + } + END_TEST + + static Suite * make_basic_suite(void) *************** *** 354,357 **** --- 426,430 ---- TCase *tc_attrs = tcase_create("attributes"); TCase *tc_xmldecl = tcase_create("XML declaration"); + TCase *tc_namespace = tcase_create("XML namespaces"); suite_add_tcase(s, tc_chars); *************** *** 378,381 **** --- 451,459 ---- tcase_add_checked_fixture(tc_xmldecl, basic_setup, basic_teardown); tcase_add_test(tc_xmldecl, test_xmldecl_misplaced); + + suite_add_tcase(s, tc_namespace); + tcase_add_checked_fixture(tc_namespace, + namespace_setup, namespace_teardown); + tcase_add_test(tc_namespace, test_return_ns_triplet); return s; From fdrake@users.sourceforge.net Fri Apr 19 15:42:04 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 14:42:04 2002 Subject: [Expat-checkins] CVS: expat/xmlwf xmlfile.c,1.8,1.9 xmlwf.c,1.57,1.58 Message-ID: Update of /cvsroot/expat/expat/xmlwf In directory usw-pr-cvs1:/tmp/cvs-serv10505 Modified Files: xmlfile.c xmlwf.c Log Message: Check in SF patch #488196: Make xmlwf read from standard input. This modifies the patch for style (slightly). The style of these files is also slightly modified in an attempt to create more consistency. (But that mostly swamps the feature patch.) Index: xmlfile.c =================================================================== RCS file: /cvsroot/expat/expat/xmlwf/xmlfile.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** xmlfile.c 21 Sep 2000 21:20:18 -0000 1.8 --- xmlfile.c 19 Apr 2002 21:41:54 -0000 1.9 *************** *** 43,48 **** } PROCESS_ARGS; ! static ! void reportError(XML_Parser parser, const XML_Char *filename) { int code = XML_GetErrorCode(parser); --- 43,48 ---- } PROCESS_ARGS; ! static void ! reportError(XML_Parser parser, const XML_Char *filename) { int code = XML_GetErrorCode(parser); *************** *** 58,66 **** } ! static ! void processFile(const void *data, ! size_t size, ! const XML_Char *filename, ! void *args) { XML_Parser parser = ((PROCESS_ARGS *)args)->parser; --- 58,64 ---- } ! static void ! processFile(const void *data, size_t size, ! const XML_Char *filename, void *args) { XML_Parser parser = ((PROCESS_ARGS *)args)->parser; *************** *** 76,81 **** #ifdef WIN32 ! static ! int isAsciiLetter(XML_Char c) { return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); --- 74,79 ---- #ifdef WIN32 ! static int ! isAsciiLetter(XML_Char c) { return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); *************** *** 84,89 **** #endif /* WIN32 */ ! static ! const XML_Char *resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree) { XML_Char *s; --- 82,88 ---- #endif /* WIN32 */ ! static const XML_Char * ! resolveSystemId(const XML_Char *base, const XML_Char *systemId, ! XML_Char **toFree) { XML_Char *s; *************** *** 97,101 **** ) return systemId; ! *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)*sizeof(XML_Char)); if (!*toFree) return systemId; --- 96,101 ---- ) return systemId; ! *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2) ! * sizeof(XML_Char)); if (!*toFree) return systemId; *************** *** 112,121 **** } ! static ! int externalEntityRefFilemap(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { int result; --- 112,121 ---- } ! static int ! externalEntityRefFilemap(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { int result; *************** *** 135,145 **** } ! static ! int processStream(const XML_Char *filename, XML_Parser parser) { ! int fd = topen(filename, O_BINARY|O_RDONLY); ! if (fd < 0) { ! tperror(filename); ! return 0; } for (;;) { --- 135,150 ---- } ! static int ! processStream(const XML_Char *filename, XML_Parser parser) { ! /* passing NULL for filename means read intput from stdin */ ! int fd = 0; /* 0 is the fileno for stdin */ ! ! if (filename != NULL) { ! fd = topen(filename, O_BINARY|O_RDONLY); ! if (fd < 0) { ! tperror(filename); ! return 0; ! } } for (;;) { *************** *** 147,167 **** char *buf = XML_GetBuffer(parser, READ_SIZE); if (!buf) { ! close(fd); ! ftprintf(stderr, T("%s: out of memory\n"), filename); return 0; } nread = read(fd, buf, READ_SIZE); if (nread < 0) { ! tperror(filename); ! close(fd); return 0; } if (!XML_ParseBuffer(parser, nread, nread == 0)) { ! reportError(parser, filename); ! close(fd); return 0; } if (nread == 0) { ! close(fd); break;; } --- 152,177 ---- char *buf = XML_GetBuffer(parser, READ_SIZE); if (!buf) { ! if (filename != NULL) ! close(fd); ! ftprintf(stderr, T("%s: out of memory\n"), ! filename != NULL ? filename : "xmlwf"); return 0; } nread = read(fd, buf, READ_SIZE); if (nread < 0) { ! tperror(filename != NULL ? filename : "STDIN"); ! if (filename != NULL) ! close(fd); return 0; } if (!XML_ParseBuffer(parser, nread, nread == 0)) { ! reportError(parser, filename != NULL ? filename : "STDIN"); ! if (filename != NULL) ! close(fd); return 0; } if (nread == 0) { ! if (filename != NULL) ! close(fd); break;; } *************** *** 170,179 **** } ! static ! int externalEntityRefStream(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { XML_Char *s; --- 180,189 ---- } ! static int ! externalEntityRefStream(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { XML_Char *s; *************** *** 189,195 **** } ! int XML_ProcessFile(XML_Parser parser, ! const XML_Char *filename, ! unsigned flags) { int result; --- 199,206 ---- } ! int ! XML_ProcessFile(XML_Parser parser, ! const XML_Char *filename, ! unsigned flags) { int result; Index: xmlwf.c =================================================================== RCS file: /cvsroot/expat/expat/xmlwf/xmlwf.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** xmlwf.c 19 Apr 2002 16:19:33 -0000 1.57 --- xmlwf.c 19 Apr 2002 21:41:54 -0000 1.58 *************** *** 22,26 **** #define NSSEP T('\001') ! static void characterData(void *userData, const XML_Char *s, int len) { FILE *fp = userData; --- 22,27 ---- #define NSSEP T('\001') ! static void ! characterData(void *userData, const XML_Char *s, int len) { FILE *fp = userData; *************** *** 57,61 **** } ! static void attributeValue(FILE *fp, const XML_Char *s) { puttc(T('='), fp); --- 58,63 ---- } ! static void ! attributeValue(FILE *fp, const XML_Char *s) { puttc(T('='), fp); *************** *** 107,117 **** is equivalent to lexicographically comparing based on the character number. */ ! static int attcmp(const void *att1, const void *att2) { return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); } ! static void startElement(void *userData, const XML_Char *name, ! const XML_Char **atts) { int nAtts; --- 109,120 ---- is equivalent to lexicographically comparing based on the character number. */ ! static int ! attcmp(const void *att1, const void *att2) { return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); } ! static void ! startElement(void *userData, const XML_Char *name, const XML_Char **atts) { int nAtts; *************** *** 136,140 **** } ! static void endElement(void *userData, const XML_Char *name) { FILE *fp = userData; --- 139,144 ---- } ! static void ! endElement(void *userData, const XML_Char *name) { FILE *fp = userData; *************** *** 145,149 **** } ! static int nsattcmp(const void *p1, const void *p2) { const XML_Char *att1 = *(const XML_Char **)p1; --- 149,154 ---- } ! static int ! nsattcmp(const void *p1, const void *p2) { const XML_Char *att1 = *(const XML_Char **)p1; *************** *** 156,161 **** } ! static void startElementNS(void *userData, const XML_Char *name, ! const XML_Char **atts) { int nAtts; --- 161,166 ---- } ! static void ! startElementNS(void *userData, const XML_Char *name, const XML_Char **atts) { int nAtts; *************** *** 205,209 **** } ! static void endElementNS(void *userData, const XML_Char *name) { FILE *fp = userData; --- 210,215 ---- } ! static void ! endElementNS(void *userData, const XML_Char *name) { FILE *fp = userData; *************** *** 223,228 **** #ifndef W3C14N ! static void processingInstruction(void *userData, const XML_Char *target, ! const XML_Char *data) { FILE *fp = userData; --- 229,235 ---- #ifndef W3C14N ! static void ! processingInstruction(void *userData, const XML_Char *target, ! const XML_Char *data) { FILE *fp = userData; *************** *** 238,283 **** #endif /* not W3C14N */ ! static void defaultCharacterData(XML_Parser parser, const XML_Char *s, int len) { XML_DefaultCurrent(parser); } ! static void defaultStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { XML_DefaultCurrent(parser); } ! static void defaultEndElement(XML_Parser parser, const XML_Char *name) { XML_DefaultCurrent(parser); } ! static void defaultProcessingInstruction(XML_Parser parser, ! const XML_Char *target, ! const XML_Char *data) { XML_DefaultCurrent(parser); } ! static void nopCharacterData(XML_Parser parser, const XML_Char *s, int len) { } ! static void nopStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { } ! static void nopEndElement(XML_Parser parser, const XML_Char *name) { } ! static void nopProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { } ! static void markup(XML_Parser parser, const XML_Char *s, int len) { FILE *fp = XML_GetUserData(parser); --- 245,297 ---- #endif /* not W3C14N */ ! static void ! defaultCharacterData(XML_Parser parser, const XML_Char *s, int len) { XML_DefaultCurrent(parser); } ! static void ! defaultStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { XML_DefaultCurrent(parser); } ! static void ! defaultEndElement(XML_Parser parser, const XML_Char *name) { XML_DefaultCurrent(parser); } ! static void ! defaultProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { XML_DefaultCurrent(parser); } ! static void ! nopCharacterData(XML_Parser parser, const XML_Char *s, int len) { } ! static void ! nopStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) { } ! static void ! nopEndElement(XML_Parser parser, const XML_Char *name) { } ! static void ! nopProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { } ! static void ! markup(XML_Parser parser, const XML_Char *s, int len) { FILE *fp = XML_GetUserData(parser); *************** *** 286,291 **** } ! static ! void metaLocation(XML_Parser parser) { const XML_Char *uri = XML_GetBase(parser); --- 300,305 ---- } ! static void ! metaLocation(XML_Parser parser) { const XML_Char *uri = XML_GetBase(parser); *************** *** 300,318 **** } ! static ! void metaStartDocument(XML_Parser parser) { fputts(T("\n"), XML_GetUserData(parser)); } ! static ! void metaEndDocument(XML_Parser parser) { fputts(T("\n"), XML_GetUserData(parser)); } ! static ! void metaStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { FILE *fp = XML_GetUserData(parser); --- 314,332 ---- } ! static void ! metaStartDocument(XML_Parser parser) { fputts(T("\n"), XML_GetUserData(parser)); } ! static void ! metaEndDocument(XML_Parser parser) { fputts(T("\n"), XML_GetUserData(parser)); } ! static void ! metaStartElement(XML_Parser parser, const XML_Char *name, ! const XML_Char **atts) { FILE *fp = XML_GetUserData(parser); *************** *** 346,351 **** } ! static ! void metaEndElement(XML_Parser parser, const XML_Char *name) { FILE *fp = XML_GetUserData(parser); --- 360,365 ---- } ! static void ! metaEndElement(XML_Parser parser, const XML_Char *name) { FILE *fp = XML_GetUserData(parser); *************** *** 355,361 **** } ! static ! void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { FILE *fp = XML_GetUserData(parser); --- 369,375 ---- } ! static void ! metaProcessingInstruction(XML_Parser parser, const XML_Char *target, ! const XML_Char *data) { FILE *fp = XML_GetUserData(parser); *************** *** 367,372 **** } ! static ! void metaComment(XML_Parser parser, const XML_Char *data) { FILE *fp = XML_GetUserData(parser); --- 381,386 ---- } ! static void ! metaComment(XML_Parser parser, const XML_Char *data) { FILE *fp = XML_GetUserData(parser); *************** *** 378,383 **** } ! static ! void metaStartCdataSection(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); --- 392,397 ---- } ! static void ! metaStartCdataSection(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); *************** *** 387,392 **** } ! static ! void metaEndCdataSection(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); --- 401,406 ---- } ! static void ! metaEndCdataSection(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); *************** *** 396,401 **** } ! static ! void metaCharacterData(XML_Parser parser, const XML_Char *s, int len) { FILE *fp = XML_GetUserData(parser); --- 410,415 ---- } ! static void ! metaCharacterData(XML_Parser parser, const XML_Char *s, int len) { FILE *fp = XML_GetUserData(parser); *************** *** 407,416 **** } ! static ! void metaStartDoctypeDecl(XML_Parser parser, ! const XML_Char *doctypeName, ! const XML_Char *sysid, ! const XML_Char *pubid, ! int has_internal_subset) { FILE *fp = XML_GetUserData(parser); --- 421,430 ---- } ! static void ! metaStartDoctypeDecl(XML_Parser parser, ! const XML_Char *doctypeName, ! const XML_Char *sysid, ! const XML_Char *pubid, ! int has_internal_subset) { FILE *fp = XML_GetUserData(parser); *************** *** 420,425 **** } ! static ! void metaEndDoctypeDecl(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); --- 434,439 ---- } ! static void ! metaEndDoctypeDecl(XML_Parser parser) { FILE *fp = XML_GetUserData(parser); *************** *** 429,438 **** } ! static ! void metaNotationDecl(XML_Parser parser, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { FILE *fp = XML_GetUserData(parser); --- 443,452 ---- } ! static void ! metaNotationDecl(XML_Parser parser, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId) { FILE *fp = XML_GetUserData(parser); *************** *** 450,463 **** ! static ! void metaEntityDecl(XML_Parser parser, ! const XML_Char *entityName, ! int is_param, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName) { FILE *fp = XML_GetUserData(parser); --- 464,477 ---- ! static void ! metaEntityDecl(XML_Parser parser, ! const XML_Char *entityName, ! int is_param, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName) { FILE *fp = XML_GetUserData(parser); *************** *** 493,500 **** } ! static ! void metaStartNamespaceDecl(XML_Parser parser, ! const XML_Char *prefix, ! const XML_Char *uri) { FILE *fp = XML_GetUserData(parser); --- 507,514 ---- } ! static void ! metaStartNamespaceDecl(XML_Parser parser, ! const XML_Char *prefix, ! const XML_Char *uri) { FILE *fp = XML_GetUserData(parser); *************** *** 511,516 **** } ! static ! void metaEndNamespaceDecl(XML_Parser parser, const XML_Char *prefix) { FILE *fp = XML_GetUserData(parser); --- 525,530 ---- } ! static void ! metaEndNamespaceDecl(XML_Parser parser, const XML_Char *prefix) { FILE *fp = XML_GetUserData(parser); *************** *** 521,534 **** } ! static ! int unknownEncodingConvert(void *data, const char *p) { return codepageConvert(*(int *)data, p); } ! static ! int unknownEncoding(void *userData, ! const XML_Char *name, ! XML_Encoding *info) { int cp; --- 535,546 ---- } ! static int ! unknownEncodingConvert(void *data, const char *p) { return codepageConvert(*(int *)data, p); } ! static int ! unknownEncoding(void *userData, const XML_Char *name, XML_Encoding *info) { int cp; *************** *** 565,576 **** } ! static ! int notStandalone(void *userData) { return 0; } ! static ! void showVersion(XML_Char *prog) { XML_Char *s = prog; --- 577,588 ---- } ! static int ! notStandalone(void *userData) { return 0; } ! static void ! showVersion(XML_Char *prog) { XML_Char *s = prog; *************** *** 584,597 **** } ! static ! void usage(const XML_Char *prog) { ftprintf(stderr, T("usage: %s [-n] [-p] [-r] [-s] [-w] [-x] [-d output-dir] " "[-e encoding] file ...\n"), prog); ! exit(1); } ! int tmain(int argc, XML_Char **argv) { int i, j; --- 596,610 ---- } ! static void ! usage(const XML_Char *prog, int rc) { ftprintf(stderr, T("usage: %s [-n] [-p] [-r] [-s] [-w] [-x] [-d output-dir] " "[-e encoding] file ...\n"), prog); ! exit(rc); } ! int ! tmain(int argc, XML_Char **argv) { int i, j; *************** *** 604,607 **** --- 617,621 ---- int requireStandalone = 0; int paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; + int useStdin = 0; #ifdef _MSC_VER *************** *** 661,665 **** if (argv[i][j + 1] == T('\0')) { if (++i == argc) ! usage(argv[0]); outputDir = argv[i]; } --- 675,679 ---- if (argv[i][j + 1] == T('\0')) { if (++i == argc) ! usage(argv[0], 2); outputDir = argv[i]; } *************** *** 672,676 **** if (argv[i][j + 1] == T('\0')) { if (++i == argc) ! usage(argv[0]); encoding = argv[i]; } --- 686,690 ---- if (argv[i][j + 1] == T('\0')) { if (++i == argc) ! usage(argv[0], 2); encoding = argv[i]; } *************** *** 680,683 **** --- 694,700 ---- j = 0; break; + case T('h'): + usage(argv[0], 0); + return 0; case T('v'): showVersion(argv[0]); *************** *** 691,699 **** /* fall through */ default: ! usage(argv[0]); } } ! if (i == argc) ! usage(argv[0]); for (; i < argc; i++) { FILE *fp = 0; --- 708,719 ---- /* fall through */ default: ! usage(argv[0], 2); } } ! if (i == argc) { ! useStdin = 1; ! processFlags &= ~XML_MAP_FILE; ! i--; ! } for (; i < argc; i++) { FILE *fp = 0; *************** *** 717,721 **** } else if (outputDir) { ! const XML_Char *file = argv[i]; if (tcsrchr(file, T('/'))) file = tcsrchr(file, T('/')) + 1; --- 737,741 ---- } else if (outputDir) { ! const XML_Char *file = useStdin ? T("STDIN") : argv[i]; if (tcsrchr(file, T('/'))) file = tcsrchr(file, T('/')) + 1; *************** *** 778,782 **** if (windowsCodePages) XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0); ! result = XML_ProcessFile(parser, argv[i], processFlags); if (outputDir) { if (outputType == 'm') --- 798,802 ---- if (windowsCodePages) XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0); ! result = XML_ProcessFile(parser, useStdin ? NULL : argv[i], processFlags); if (outputDir) { if (outputType == 'm') From fdrake@users.sourceforge.net Fri Apr 19 20:54:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Apr 19 19:54:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.10,1.11 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv7244/tests Modified Files: runtests.c Log Message: Fix typo in comment. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** runtests.c 19 Apr 2002 20:59:01 -0000 1.10 --- runtests.c 20 Apr 2002 02:53:15 -0000 1.11 *************** *** 27,31 **** /* Generate a failure using the parser state to create an error message; ! * this should be used when the parser reports and error we weren't * expecting. */ --- 27,31 ---- /* Generate a failure using the parser state to create an error message; ! * this should be used when the parser reports an error we weren't * expecting. */ From fdrake@users.sourceforge.net Sat Apr 20 07:12:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 06:12:02 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.22,1.23 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv22218 Modified Files: Makefile.in Log Message: Simplify the command used to run the test program. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Makefile.in 19 Apr 2002 18:57:24 -0000 1.22 --- Makefile.in 20 Apr 2002 13:11:16 -0000 1.23 *************** *** 76,80 **** check: tests/runtests ! @cd tests && ./runtests install: xmlwf/xmlwf lib/$(LIBRARY) lib/$(APIHEADER) --- 76,80 ---- check: tests/runtests ! tests/runtests install: xmlwf/xmlwf lib/$(LIBRARY) lib/$(APIHEADER) From fdrake@users.sourceforge.net Sat Apr 20 07:20:03 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 06:20:03 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.11,1.12 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv24619/tests Modified Files: runtests.c Log Message: Added test for SF bug #480278. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** runtests.c 20 Apr 2002 02:53:15 -0000 1.11 --- runtests.c 20 Apr 2002 13:19:40 -0000 1.12 *************** *** 237,240 **** --- 237,258 ---- END_TEST + START_TEST(test_utf16) + { + /* + * some text + */ + char text[] = + "\000<\000?\000x\000m\000\154\000 \000v\000e\000r\000s\000i\000o" + "\000n\000=\000'\0001\000.\000\060\000'\000 \000e\000n\000c\000o" + "\000d\000i\000n\000g\000=\000'\000U\000T\000F\000-\0001\000\066" + "\000'\000?\000>\000\n" + "\000<\000d\000o\000c\000 \000a\000=\000'\0001\0002\0003\000'" + "\000>\000s\000o\000m\000e\000 \000t\000e\000x\000t\000<\000/" + "\000d\000o\000c\000>"; + if (!XML_Parse(parser, text, sizeof(text) - 1, 1)) + xml_failure(); + } + END_TEST + /* Helpers used by the following test; this checks any "attr" and "refs" *************** *** 436,439 **** --- 454,458 ---- tcase_add_test(tc_chars, test_bom_utf16_le); tcase_add_test(tc_chars, test_illegal_utf8); + tcase_add_test(tc_chars, test_utf16); /* Regression test for SF bug #491986. */ tcase_add_test(tc_chars, test_danish_latin1); From fdrake@users.sourceforge.net Sat Apr 20 07:26:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 06:26:02 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.23,1.24 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv26167 Modified Files: Makefile.in Log Message: Added missing library to link line for tests; not sure how this had not been checked in! Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Makefile.in 20 Apr 2002 13:11:16 -0000 1.23 --- Makefile.in 20 Apr 2002 13:24:59 -0000 1.24 *************** *** 146,150 **** tests/runtests.o: tests/runtests.c tests/runtests: tests/runtests.o lib/$(LIBRARY) ! $(LINK_EXE) $< lib/$(LIBRARY) .SUFFIXES: .c .lo .o --- 146,150 ---- tests/runtests.o: tests/runtests.c tests/runtests: tests/runtests.o lib/$(LIBRARY) ! $(LINK_EXE) $< lib/$(LIBRARY) -lcheck .SUFFIXES: .c .lo .o From fdrake@users.sourceforge.net Sat Apr 20 15:15:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 14:15:02 2002 Subject: [Expat-checkins] CVS: expat configure.in,1.26,1.27 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv18198 Modified Files: configure.in Log Message: Add missing word in comment. Index: configure.in =================================================================== RCS file: /cvsroot/expat/expat/configure.in,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** configure.in 7 Dec 2001 10:19:30 -0000 1.26 --- configure.in 20 Apr 2002 21:14:48 -0000 1.27 *************** *** 49,53 **** dnl dnl Be careful about adding the -fexceptions option; some versions of ! dnl don't support it and it causes extra warnings that are only dnl distracting; avoid. dnl --- 49,53 ---- dnl dnl Be careful about adding the -fexceptions option; some versions of ! dnl GCC don't support it and it causes extra warnings that are only dnl distracting; avoid. dnl From fdrake@users.sourceforge.net Sat Apr 20 15:16:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 14:16:02 2002 Subject: [Expat-checkins] CVS: expat README,1.12,1.13 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv18440 Modified Files: README Log Message: Bump the release number. Remove text about -fexceptions for use with C++; that is added automatically now. Index: README =================================================================== RCS file: /cvsroot/expat/expat/README,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** README 9 Nov 2001 04:57:33 -0000 1.12 --- README 20 Apr 2002 21:15:46 -0000 1.13 *************** *** 1,4 **** ! Expat, Release 1.95.2 This is expat, a C library for parsing XML, written by James Clark. --- 1,4 ---- ! Expat, Release 1.95.3 This is expat, a C library for parsing XML, written by James Clark. *************** *** 43,53 **** location. Note that you need to have write permission into the directories into which things will be installed. - - When building for use with C++, you may need to add additional - compiler flags to support proper interaction with exceptions. This - can be done by setting the CFLAGS environment variable. For example, - when using GCC, you can use: - - CFLAGS=-fexceptions ./configure Note for Solaris users: The "ar" command is usually located in --- 43,46 ---- From fdrake@users.sourceforge.net Sat Apr 20 15:18:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 14:18:02 2002 Subject: [Expat-checkins] CVS: expat/lib expat.h,1.14,1.15 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv18790/lib Modified Files: expat.h Log Message: Bump version number. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** expat.h 23 Aug 2001 12:35:53 -0000 1.14 --- expat.h 20 Apr 2002 21:17:15 -0000 1.15 *************** *** 733,737 **** #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 2 #ifdef __cplusplus --- 733,737 ---- #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 3 #ifdef __cplusplus From fdrake@users.sourceforge.net Sat Apr 20 15:33:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat Apr 20 14:33:02 2002 Subject: [Expat-checkins] CVS: expat COPYING,1.1,1.2 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv23228 Modified Files: COPYING Log Message: Added another line to the copyright notice. Index: COPYING =================================================================== RCS file: /cvsroot/expat/expat/COPYING,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** COPYING 18 Sep 2000 16:26:20 -0000 1.1 --- COPYING 20 Apr 2002 21:32:22 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper + Copyright (c) 2001, 2002 Expat maintainers. Permission is hereby granted, free of charge, to any person obtaining From gstein@users.sourceforge.net Mon Apr 22 04:23:05 2002 From: gstein@users.sourceforge.net (Greg Stein) Date: Mon Apr 22 03:23:05 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.24,1.25 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv12593 Modified Files: Makefile.in Log Message: xmlwf should depend on the library, too. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Makefile.in 20 Apr 2002 13:24:59 -0000 1.24 --- Makefile.in 22 Apr 2002 10:22:48 -0000 1.25 *************** *** 133,137 **** xmlwf/codepage.o: xmlwf/codepage.c xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c ! xmlwf/xmlwf: $(XMLWF_OBJS) $(LINK_EXE) $(XMLWF_OBJS) lib/$(LIBRARY) --- 133,137 ---- xmlwf/codepage.o: xmlwf/codepage.c xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c ! xmlwf/xmlwf: $(XMLWF_OBJS) lib/$(LIBRARY) $(LINK_EXE) $(XMLWF_OBJS) lib/$(LIBRARY) From gstein@lyra.org Mon Apr 22 04:32:03 2002 From: gstein@lyra.org (Greg Stein) Date: Mon Apr 22 03:32:03 2002 Subject: [Expat-checkins] CVS: expat/xmlwf xmlfile.c,1.8,1.9 xmlwf.c,1.57,1.58 In-Reply-To: ; from fdrake@users.sourceforge.net on Fri, Apr 19, 2002 at 02:41:56PM -0700 References: Message-ID: <20020422033223.E30659@lyra.org> On Fri, Apr 19, 2002 at 02:41:56PM -0700, Fred L. Drake wrote: > Update of /cvsroot/expat/expat/xmlwf > In directory usw-pr-cvs1:/tmp/cvs-serv10505 > > Modified Files: > xmlfile.c xmlwf.c > Log Message: > Check in SF patch #488196: Make xmlwf read from standard input. > This modifies the patch for style (slightly). > > The style of these files is also slightly modified in an attempt to create > more consistency. (But that mostly swamps the feature patch.) Putting on my reviewer's hat, you should have separated the two checkins so that they could be more easily reviewed. :-) Cheers, -g -- Greg Stein, http://www.lyra.org/ From fdrake@acm.org Mon Apr 22 08:12:25 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon Apr 22 07:12:25 2002 Subject: [Expat-checkins] CVS: expat/xmlwf xmlfile.c,1.8,1.9 xmlwf.c,1.57,1.58 In-Reply-To: <20020422033223.E30659@lyra.org> References: <20020422033223.E30659@lyra.org> Message-ID: <15556.6610.712103.521269@grendel.zope.com> Greg Stein writes: > Putting on my reviewer's hat, you should have separated the two checkins so > that they could be more easily reviewed. :-) Yeah, I should have. I was just too lazy to back out half of the style changes when I thought about that. ;-) -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@users.sourceforge.net Mon Apr 22 11:04:08 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 22 10:04:08 2002 Subject: [Expat-checkins] CVS: expat/doc xmlwf.1,NONE,1.1 Message-ID: Update of /cvsroot/expat/expat/doc In directory usw-pr-cvs1:/tmp/cvs-serv10874 Added Files: xmlwf.1 Log Message: Formatted version of the Unix manpage, ready for installation. --- NEW FILE: xmlwf.1 --- .\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "XMLWF" "1" "22 April 2002" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS \fBxmlwf\fR [ \fB-s\fR] [ \fB-n\fR] [ \fB-p\fR] [ \fB-x\fR] [ \fB-e \fIencoding\fB\fR] [ \fB-w\fR] [ \fB-d \fIoutput-dir\fB\fR] [ \fB-c\fR] [ \fB-m\fR] [ \fB-r\fR] [ \fB-t\fR] [ \fB-v\fR] [ \fBfile ...\fR] .SH "DESCRIPTION" .PP \fBxmlwf\fR uses the Expat library to determine if an XML document is well-formed. It is non-validating. .PP If you do not specify any files on the command-line, and you have a recent version of xmlwf, the input file will be read from stdin. .SH "WELL-FORMED DOCUMENTS" .PP A well-formed document must adhere to the following rules: .TP 0.2i \(bu The file begins with an XML declaration. For instance, . \fBNOTE:\fR xmlwf does not currently check for a valid XML declaration. .TP 0.2i \(bu Every start tag is either empty () or has a corresponding end tag. .TP 0.2i \(bu There is exactly one root element. This element must contain all other elements in the document. Only comments, white space, and processing instructions may come after the close of the root element. .TP 0.2i \(bu All elements nest properly. .TP 0.2i \(bu All attribute values are enclosed in quotes (either single or double). .PP If the document has a DTD, and it strictly complies with that DTD, then the document is also considered \fBvalid\fR. xmlwf is a non-validating parser -- it does not check the DTD. However, it does support external entities (see the -x option). .SH "OPTIONS" .PP When an option includes an argument, you may specify the argument either separate ("d output") or mashed ("-doutput"). xmlwf supports both. .TP \fB-c\fR If the input file is well-formed and xmlwf doesn't encounter any errors, the input file is simply copied to the output directory unchanged. This implies no namespaces (turns off -n) and requires -d to specify an output file. .TP \fB-d output-dir\fR Specifies a directory to contain transformed representations of the input files. By default, -d outputs a canonical representation (described below). You can select different output formats using -c and -m. The output filenames will be exactly the same as the input filenames or "STDIN" if the input is coming from STDIN. Therefore, you must be careful that the output file does not go into the same directory as the input file. Otherwise, xmlwf will delete the input file before it generates the output file (just like running cat < file > file in most shells). Two structurally equivalent XML documents have a byte-for-byte identical canonical XML representation. Note that ignorable white space is considered significant and is treated equivalently to data. More on canonical XML can be found at http://www.jclark.com/xml/canonxml.html . .TP \fB-e encoding\fR Specifies the character encoding for the document, overriding any document encoding declaration. xmlwf has four built-in encodings: US-ASCII, UTF-8, UTF-16, and ISO-8859-1. Also see the -w option. .TP \fB-m\fR Outputs some strange sort of XML file that completely describes the the input file, including character postitions. Requires -d to specify an output file. .TP \fB-n\fR Turns on namespace processing. (describe namespaces) -c disables namespaces. .TP \fB-p\fR Tells xmlwf to process external DTDs and parameter entities. Normally xmlwf never parses parameter entities. -p tells it to always parse them. -p implies -x. .TP \fB-r\fR Normally xmlwf memory-maps the XML file before parsing. -r turns off memory-mapping and uses normal file IO calls instead. Of course, memory-mapping is automatically turned off when reading from STDIN. .TP \fB-s\fR Prints an error if the document is not standalone. A document is standalone if it has no external subset and no references to parameter entities. .TP \fB-t\fR Turns on timings. This tells Expat to parse the entire file, but not perform any processing. This gives a fairly accurate idea of the raw speed of Expat itself without client overhead. -t turns off most of the output options (-d, -m -c, ...). .TP \fB-v\fR Prints the version of the Expat library being used, and then exits. .TP \fB-w\fR Enables Windows code pages. Normally, xmlwf will throw an error if it runs across an encoding that it is not equipped to handle itself. With -w, xmlwf will try to use a Windows code page. See also -e. .TP \fB-x\fR Turns on parsing external entities. Non-validating parsers are not required to resolve external entities, or even expand entities at all. Expat always expands internal entities (?), but external entity parsing must be enabled explicitly. External entities are simply entities that obtain their data from outside the XML file currently being parsed. This is an example of an internal entity: .nf .fi And here are some examples of external entities: .nf (parsed) (unparsed) .fi .TP \fB--\fR For some reason, xmlwf specifically ignores "--" anywhere it appears on the command line. .PP Older versions of xmlwf do not support reading from STDIN. .SH "OUTPUT" .PP If an input file is not well-formed, xmlwf outputs a single line describing the problem to STDOUT. If a file is well formed, xmlwf outputs nothing. Note that the result code is \fBnot\fR set. .SH "BUGS" .PP According to the W3C standard, an XML file without a declaration at the beginning is not considered well-formed. However, xmlwf allows this to pass. .PP xmlwf returns a 0 - noerr result, even if the file is not well-formed. There is no good way for a program to use xmlwf to quickly check a file -- it must parse xmlwf's STDOUT. .PP The errors should go to STDERR, not stdout. .PP There should be a way to get -d to send its output to STDOUT rather than forcing the user to send it to a file. .PP I have no idea why anyone would want to use the -d, -c and -m options. If someone could explain it to me, I'd like to add this information to this manpage. .SH "ALTERNATIVES" .PP Here are some XML validators on the web: .nf http://www.hcrc.ed.ac.uk/~richard/xml-check.html http://www.stg.brown.edu/service/xmlvalid/ http://www.scripting.com/frontier5/xml/code/xmlValidator.html http://www.xml.com/pub/a/tools/ruwf/check.html From fdrake@users.sourceforge.net Mon Apr 22 11:05:14 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 22 10:05:14 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.25,1.26 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv11342 Modified Files: Makefile.in Log Message: Add support for the xmlwf manpage, both for install and uninstall. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Makefile.in 22 Apr 2002 10:22:48 -0000 1.25 --- Makefile.in 22 Apr 2002 17:04:36 -0000 1.26 *************** *** 83,86 **** --- 83,87 ---- $(LIBTOOL) --mode=install $(INSTALL) lib/$(LIBRARY) $(libdir)/$(LIBRARY) $(INSTALL_DATA) lib/$(APIHEADER) $(includedir) + $(INSTALL_DATA) doc/xmlwf.1 $(prefix)/man/man1 uninstall: *************** *** 88,91 **** --- 89,93 ---- $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY) rm -f $(libdir)/$(APIHEADER) + rm -f $(prefix)/man/man1/xmlwf.1 # for VPATH builds (invoked by configure) From fdrake@users.sourceforge.net Mon Apr 22 12:47:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 22 11:47:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.12,1.13 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv24905/tests Modified Files: runtests.c Log Message: Test support enhancements: _xml_failure(): Clean up the output message so the first line doesn't wrap in the typical case. CharData typedef: If count is less than 0, consider it "unset". This is used in the new support to check attribute values. accumulate_characters(): Handle storage->count < 0. Allow XML_Char to be more than one byte. accumulate_attribute(): New function: store the value of the first attribute encountered in parsing. This needs the concept of a CharData that is unset to allow capturing a value that is an empty string. check_characters(): Handle storage->count < 0. Allow XML_Char to be more than one byte. run_character_check(): Create a local parser so that both run_character_check() and run_attribute_check() can be used in a single test function. run_attribute_check(): New function: check that the value of the first attribute in a document matches the expected value. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** runtests.c 20 Apr 2002 13:19:40 -0000 1.12 --- runtests.c 22 Apr 2002 18:46:00 -0000 1.13 *************** *** 34,38 **** { char buffer[1024]; ! sprintf(buffer, "%s (line %d, offset %d)\n reported from %s, line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), --- 34,39 ---- { char buffer[1024]; ! sprintf(buffer, ! "\n %s (line %d, offset %d)\n reported from %s, line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), *************** *** 118,122 **** typedef struct { ! int count; XML_Char data[1024]; } CharData; --- 119,123 ---- typedef struct { ! int count; /* # of chars, < 0 if not set */ XML_Char data[1024]; } CharData; *************** *** 126,131 **** { CharData *storage = (CharData *)userData; if (len + storage->count < sizeof(storage->data)) { ! memcpy(storage->data + storage->count, s, len); storage->count += len; } --- 127,135 ---- { CharData *storage = (CharData *)userData; + if (storage->count < 0) + storage->count = 0; if (len + storage->count < sizeof(storage->data)) { ! memcpy(storage->data + storage->count, s, ! len * sizeof(storage->data[0])); storage->count += len; } *************** *** 133,140 **** --- 137,165 ---- static void + accumulate_attribute(void *userData, const XML_Char *name, + const XML_Char **atts) + { + CharData *storage = (CharData *)userData; + if (storage->count < 0 && atts != NULL && atts[0] != NULL) { + /* "accumulate" the value of the first attribute we see */ + int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); + int i; + for (i = 0; i < maxchars; ++i) { + XML_Char ch = atts[1][i]; + if (ch == 0) + break; + storage->data[i] = ch; + } + storage->count = i; + } + } + + static void check_characters(CharData *storage, XML_Char *expected) { char buffer[1024]; int len = strlen(expected); + if (storage->count < 0) + storage->count = 0; if (len != storage->count) { sprintf(buffer, "wrong number of data characters: got %d, expected %d", *************** *** 143,147 **** return; } ! if (memcmp(expected, storage->data, len) != 0) fail("got bad data bytes"); } --- 168,172 ---- return; } ! if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) fail("got bad data bytes"); } *************** *** 151,155 **** { CharData storage; ! storage.count = 0; XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); --- 176,185 ---- { CharData storage; ! XML_Parser parser = XML_ParserCreate(NULL); ! ! if (parser == NULL) ! fail("Parser not created."); ! ! storage.count = -1; XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); *************** *** 157,160 **** --- 187,209 ---- xml_failure(); check_characters(&storage, expected); + XML_ParserFree(parser); + } + + static void + run_attribute_check(XML_Char *text, XML_Char *expected) + { + CharData storage; + XML_Parser parser = XML_ParserCreate(NULL); + + if (parser == NULL) + fail("Parser not created."); + + storage.count = -1; /* magical "not-set" value */ + XML_SetUserData(parser, &storage); + XML_SetStartElementHandler(parser, accumulate_attribute); + if (!XML_Parse(parser, text, strlen(text), 1)) + xml_failure(); + check_characters(&storage, expected); + XML_ParserFree(parser); } From fdrake@users.sourceforge.net Mon Apr 22 12:51:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 22 11:51:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.13,1.14 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv26540/tests Modified Files: runtests.c Log Message: Add a new test that demonstrates SF bug #481609 is invalid. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** runtests.c 22 Apr 2002 18:46:00 -0000 1.13 --- runtests.c 22 Apr 2002 18:50:18 -0000 1.14 *************** *** 304,307 **** --- 304,323 ---- END_TEST + /* Regression test for SF bug #481609. */ + START_TEST(test_latin1_umlauts) + { + char *text = + "\n" + "ä ö ü ä ö ü ä ö ü"; + char *utf8 = + "\xC3\xA4 \xC3\xB6 \xC3\xBC " + "\xC3\xA4 \xC3\xB6 \xC3\xBC " + "\xC3\xA4 \xC3\xB6 \xC3\xBC"; + run_character_check(text, utf8); + run_attribute_check(text, utf8); + } + END_TEST + /* Helpers used by the following test; this checks any "attr" and "refs" *************** *** 504,507 **** --- 520,524 ---- tcase_add_test(tc_chars, test_illegal_utf8); tcase_add_test(tc_chars, test_utf16); + tcase_add_test(tc_chars, test_latin1_umlauts); /* Regression test for SF bug #491986. */ tcase_add_test(tc_chars, test_danish_latin1); From kwaclaw@users.sourceforge.net Tue Apr 23 07:50:17 2002 From: kwaclaw@users.sourceforge.net (Karl Waclawek) Date: Tue Apr 23 06:50:17 2002 Subject: [Expat-checkins] CVS: expat/lib expat.h,1.15,1.16 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv27004 Modified Files: expat.h Log Message: XML_UNICODE fixes Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** expat.h 20 Apr 2002 21:17:15 -0000 1.15 --- expat.h 23 Apr 2002 13:48:50 -0000 1.16 *************** *** 21,29 **** #endif typedef void *XML_Parser; ! /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; enum XML_Content_Type { --- 21,42 ---- #endif + #ifdef XML_UNICODE_WCHAR_T + # define XML_UNICODE + #endif + typedef void *XML_Parser; ! #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ ! # ifdef XML_UNICODE_WCHAR_T ! typedef wchar_t XML_Char; ! typedef wchar_t XML_LChar; ! # else ! typedef unsigned short XML_Char; ! typedef char XML_LChar; ! # endif ! #else /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; + #endif enum XML_Content_Type { From kwaclaw@users.sourceforge.net Tue Apr 23 07:51:32 2002 From: kwaclaw@users.sourceforge.net (Karl Waclawek) Date: Tue Apr 23 06:51:32 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.26,1.27 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv27194 Modified Files: xmlparse.c Log Message: XML_UNICODE fixes Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** xmlparse.c 19 Apr 2002 20:52:39 -0000 1.26 --- xmlparse.c 23 Apr 2002 13:49:31 -0000 1.27 *************** *** 55,62 **** #endif ! #ifdef XML_UNICODE_WCHAR_T ! #define XML_T(x) L ## x ! #else #define XML_T(x) x #endif --- 55,73 ---- #endif ! #ifdef XML_UNICODE ! ! # ifdef XML_UNICODE_WCHAR_T ! # define XML_T(x) (const wchar_t)x ! # define XML_L(x) L ## x ! # else ! # define XML_T(x) (const unsigned short)x ! # define XML_L(x) x ! # endif ! ! #else ! #define XML_T(x) x + #define XML_L(x) x + #endif *************** *** 431,435 **** STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; ! char *m_groupConnector; unsigned m_groupSize; int m_hadExternalDoctype; --- 442,446 ---- STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; ! char *m_groupConnector; unsigned m_groupSize; int m_hadExternalDoctype; *************** *** 564,579 **** XML_Parser parser; ! static ! const XML_Char implicitContext[] = { ! XML_T('x'), XML_T('m'), XML_T('l'), XML_T('='), ! XML_T('h'), XML_T('t'), XML_T('t'), XML_T('p'), XML_T(':'), ! XML_T('/'), XML_T('/'), XML_T('w'), XML_T('w'), XML_T('w'), ! XML_T('.'), XML_T('w'), XML_T('3'), ! XML_T('.'), XML_T('o'), XML_T('r'), XML_T('g'), ! XML_T('/'), XML_T('X'), XML_T('M'), XML_T('L'), ! XML_T('/'), XML_T('1'), XML_T('9'), XML_T('9'), XML_T('8'), ! XML_T('/'), XML_T('n'), XML_T('a'), XML_T('m'), XML_T('e'), ! XML_T('s'), XML_T('p'), XML_T('a'), XML_T('c'), XML_T('e'), ! XML_T('\0') }; --- 575,583 ---- XML_Parser parser; ! static const XML_Char implicitContext[] = { ! 'x', 'm', 'l', '=', 'h', 't', 't', 'p', ':', '/', '/', ! 'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/', ! 'X', 'M', 'L', '/', '1', '9', '9', '8', '/', ! 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0' }; *************** *** 1313,1339 **** static const XML_LChar *message[] = { 0, ! XML_T("out of memory"), ! XML_T("syntax error"), ! XML_T("no element found"), ! XML_T("not well-formed (invalid token)"), ! XML_T("unclosed token"), ! XML_T("partial character"), ! XML_T("mismatched tag"), ! XML_T("duplicate attribute"), ! XML_T("junk after document element"), ! XML_T("illegal parameter entity reference"), ! XML_T("undefined entity"), ! XML_T("recursive entity reference"), ! XML_T("asynchronous entity"), ! XML_T("reference to invalid character number"), ! XML_T("reference to binary entity"), ! XML_T("reference to external entity in attribute"), ! XML_T("xml processing instruction not at start of external entity"), ! XML_T("unknown encoding"), ! XML_T("encoding specified in XML declaration is incorrect"), ! XML_T("unclosed CDATA section"), ! XML_T("error in processing external entity reference"), ! XML_T("document is not standalone"), ! XML_T("unexpected parser state - please send a bug report") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) --- 1317,1343 ---- static const XML_LChar *message[] = { 0, ! XML_L("out of memory"), ! XML_L("syntax error"), ! XML_L("no element found"), ! XML_L("not well-formed (invalid token)"), ! XML_L("unclosed token"), ! XML_L("partial character"), ! XML_L("mismatched tag"), ! XML_L("duplicate attribute"), ! XML_L("junk after document element"), ! XML_L("illegal parameter entity reference"), ! XML_L("undefined entity"), ! XML_L("recursive entity reference"), ! XML_L("asynchronous entity"), ! XML_L("reference to invalid character number"), ! XML_L("reference to binary entity"), ! XML_L("reference to external entity in attribute"), ! XML_L("xml processing instruction not at start of external entity"), ! XML_L("unknown encoding"), ! XML_L("encoding specified in XML declaration is incorrect"), ! XML_L("unclosed CDATA section"), ! XML_L("error in processing external entity reference"), ! XML_L("document is not standalone"), ! XML_L("unexpected parser state - please send a bug report") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) *************** *** 1353,1357 **** /* ### I'm assuming cpp is portable in this respect... */ ! #define V1(a,b,c) "expat_"#a"."#b"."#c #define V2(a,b,c) V1(a,b,c) --- 1357,1361 ---- /* ### I'm assuming cpp is portable in this respect... */ ! #define V1(a,b,c) XML_L("expat_")XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c) #define V2(a,b,c) V1(a,b,c) *************** *** 1915,1919 **** const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; ! int prefixLen = 0; int i; int n; --- 1919,1923 ---- const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; ! int prefixLen; int i; int n; *************** *** 2075,2079 **** return XML_ERROR_NO_MEMORY; } ! while (*s++ != ':') ; do { --- 2079,2083 ---- return XML_ERROR_NO_MEMORY; } ! while (*s++ != XML_T(':')) ; do { *************** *** 2121,2137 **** } else ! localPart = NULL; if (ns && ns_triplets && binding->prefix->name) { ! for (prefixLen = 0; binding->prefix->name[prefixLen++];) ; - n += prefixLen; } - else - return XML_ERROR_NONE; tagNamePtr->localPart = localPart; tagNamePtr->uriLen = binding->uriLen; for (i = 0; localPart[i++];) ; ! n = i + binding->uriLen; if (n > binding->uriAlloc) { TAG *p; --- 2125,2139 ---- } else ! return XML_ERROR_NONE; ! prefixLen = 0; if (ns && ns_triplets && binding->prefix->name) { ! for (prefixLen; binding->prefix->name[prefixLen++];) ; } tagNamePtr->localPart = localPart; tagNamePtr->uriLen = binding->uriLen; for (i = 0; localPart[i++];) ; ! n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { TAG *p; *************** *** 2435,2443 **** { const char *encodingName = 0; ! const char *storedEncName = 0; const ENCODING *newEncoding = 0; const char *version = 0; const char *versionend; ! const char *storedversion = 0; int standalone = -1; if (!(ns --- 2437,2445 ---- { const char *encodingName = 0; ! const XML_Char *storedEncName = 0; const ENCODING *newEncoding = 0; const char *version = 0; const char *versionend; ! const XML_Char *storedversion = 0; int standalone = -1; if (!(ns *************** *** 2590,2594 **** --- 2592,2608 ---- static const XML_Char externalSubsetName[] = { '#' , '\0' }; #endif /* XML_DTD */ + static const XML_Char atypeCDATA[] = { 'C', 'D', 'A', 'T', 'A' }; + static const XML_Char atypeID[] = { 'I', 'D' }; + static const XML_Char atypeIDREF[] = { 'I', 'D', 'R', 'E', 'F' }; + static const XML_Char atypeIDREFS[] = { 'I', 'D', 'R', 'E', 'F', 'S' }; + static const XML_Char atypeENTITY[] = { 'E', 'N', 'T', 'I', 'T', 'Y' }; + static const XML_Char atypeENTITIES[] = { 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S' }; + static const XML_Char atypeNMTOKEN[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N' }; + static const XML_Char atypeNMTOKENS[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S' }; + static const XML_Char notationPrefix[] = { 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N', '(' }; + static const XML_Char enumValueSep[] = { '|' }; + static const XML_Char enumValueStart[] = { '(' }; + const char **eventPP; const char **eventEndPP; *************** *** 2679,2683 **** case XML_ROLE_DOCTYPE_PUBLIC_ID: if (startDoctypeDeclHandler) { ! doctypePubid = poolStoreString(&tempPool, enc, s + 1, next - 1); if (! doctypePubid) return XML_ERROR_NO_MEMORY; --- 2693,2697 ---- case XML_ROLE_DOCTYPE_PUBLIC_ID: if (startDoctypeDeclHandler) { ! doctypePubid = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! doctypePubid) return XML_ERROR_NO_MEMORY; *************** *** 2755,2781 **** case XML_ROLE_ATTRIBUTE_TYPE_CDATA: declAttributeIsCdata = 1; ! declAttributeType = "CDATA"; break; case XML_ROLE_ATTRIBUTE_TYPE_ID: declAttributeIsId = 1; ! declAttributeType = "ID"; break; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: ! declAttributeType = "IDREF"; break; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: ! declAttributeType = "IDREFS"; break; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: ! declAttributeType = "ENTITY"; break; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: ! declAttributeType = "ENTITIES"; break; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: ! declAttributeType = "NMTOKEN"; break; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: ! declAttributeType = "NMTOKENS"; break; --- 2769,2795 ---- case XML_ROLE_ATTRIBUTE_TYPE_CDATA: declAttributeIsCdata = 1; ! declAttributeType = atypeCDATA; break; case XML_ROLE_ATTRIBUTE_TYPE_ID: declAttributeIsId = 1; ! declAttributeType = atypeID; break; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: ! declAttributeType = atypeIDREF; break; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: ! declAttributeType = atypeIDREFS; break; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: ! declAttributeType = atypeENTITY; break; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: ! declAttributeType = atypeENTITIES; break; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: ! declAttributeType = atypeNMTOKEN; break; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: ! declAttributeType = atypeNMTOKENS; break; *************** *** 2784,2795 **** if (attlistDeclHandler) { ! char *prefix; if (declAttributeType) { ! prefix = "|"; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ! ? "NOTATION(" ! : "("); } if (! poolAppendString(&tempPool, prefix)) --- 2798,2809 ---- if (attlistDeclHandler) { ! const XML_Char *prefix; if (declAttributeType) { ! prefix = enumValueSep; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ! ? notationPrefix ! : enumValueStart); } if (! poolAppendString(&tempPool, prefix)) *************** *** 2808,2816 **** return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { ! if (*declAttributeType == '(' ! || (*declAttributeType == 'N' && declAttributeType[1] == 'O')) { /* Enumerated or Notation type */ ! if (! poolAppendChar(&tempPool, ')') ! || ! poolAppendChar(&tempPool, '\0')) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; --- 2822,2831 ---- return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { ! if (*declAttributeType == XML_T('(') ! || (*declAttributeType == XML_T('N') ! && declAttributeType[1] == XML_T('O'))) { /* Enumerated or Notation type */ ! if (! poolAppendChar(&tempPool, XML_T(')')) ! || ! poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; *************** *** 2843,2851 **** return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { ! if (*declAttributeType == '(' ! || (*declAttributeType == 'N' && declAttributeType[1] == 'O')) { /* Enumerated or Notation type */ ! if (! poolAppendChar(&tempPool, ')') ! || ! poolAppendChar(&tempPool, '\0')) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; --- 2858,2867 ---- return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { ! if (*declAttributeType == XML_T('(') ! || (*declAttributeType == XML_T('N') ! && declAttributeType[1] == XML_T('O'))) { /* Enumerated or Notation type */ ! if (! poolAppendChar(&tempPool, XML_T(')')) ! || ! poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; *************** *** 2888,2892 **** case XML_ROLE_DOCTYPE_SYSTEM_ID: if (startDoctypeDeclHandler) { ! doctypeSysid = poolStoreString(&tempPool, enc, s + 1, next - 1); if (! doctypeSysid) return XML_ERROR_NO_MEMORY; --- 2904,2910 ---- case XML_ROLE_DOCTYPE_SYSTEM_ID: if (startDoctypeDeclHandler) { ! doctypeSysid = poolStoreString(&tempPool, enc, ! s + enc->minBytesPerChar, ! next - enc->minBytesPerChar); if (! doctypeSysid) return XML_ERROR_NO_MEMORY; *************** *** 3246,3250 **** { ELEMENT_TYPE *el; ! const char *nxt = quant == XML_CQUANT_NONE ? next : next - 1; int myindex = nextScaffoldPart(parser); if (myindex < 0) --- 3264,3268 ---- { ELEMENT_TYPE *el; ! const char *nxt = quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar; int myindex = nextScaffoldPart(parser); if (myindex < 0) *************** *** 3982,3986 **** poolDiscard(&tempPool); } ! else if (*s == '=') { PREFIX *prefix; if (poolLength(&tempPool) == 0) --- 4000,4004 ---- poolDiscard(&tempPool); } ! else if (*s == XML_T('=')) { PREFIX *prefix; if (poolLength(&tempPool) == 0) *************** *** 4651,4660 **** XML_Content *dest, XML_Content **contpos, ! char **strpos) { dest->type = dtd.scaffold[src_node].type; dest->quant = dtd.scaffold[src_node].quant; if (dest->type == XML_CTYPE_NAME) { ! const char *src; dest->name = *strpos; src = dtd.scaffold[src_node].name; --- 4669,4678 ---- XML_Content *dest, XML_Content **contpos, ! XML_Char **strpos) { dest->type = dtd.scaffold[src_node].type; dest->quant = dtd.scaffold[src_node].quant; if (dest->type == XML_CTYPE_NAME) { ! const XML_Char *src; dest->name = *strpos; src = dtd.scaffold[src_node].name; *************** *** 4688,4693 **** XML_Content *ret; XML_Content *cpos; ! char * str; ! int allocsize = dtd.scaffCount * sizeof(XML_Content) + dtd.contentStringLen; ret = MALLOC(allocsize); --- 4706,4711 ---- XML_Content *ret; XML_Content *cpos; ! XML_Char * str; ! int allocsize = dtd.scaffCount * sizeof(XML_Content) + (dtd.contentStringLen * sizeof(XML_Char)); ret = MALLOC(allocsize); *************** *** 4695,4699 **** return 0; ! str = (char *) (&ret[dtd.scaffCount]); cpos = &ret[1]; --- 4713,4717 ---- return 0; ! str = (XML_Char *) (&ret[dtd.scaffCount]); cpos = &ret[1]; From kwaclaw@users.sourceforge.net Tue Apr 23 13:50:40 2002 From: kwaclaw@users.sourceforge.net (Karl Waclawek) Date: Tue Apr 23 12:50:40 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.27,1.28 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv26836 Modified Files: xmlparse.c Log Message: Attribute type constants did not have null terminators. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** xmlparse.c 23 Apr 2002 13:49:31 -0000 1.27 --- xmlparse.c 23 Apr 2002 19:48:29 -0000 1.28 *************** *** 2592,2607 **** static const XML_Char externalSubsetName[] = { '#' , '\0' }; #endif /* XML_DTD */ ! static const XML_Char atypeCDATA[] = { 'C', 'D', 'A', 'T', 'A' }; ! static const XML_Char atypeID[] = { 'I', 'D' }; ! static const XML_Char atypeIDREF[] = { 'I', 'D', 'R', 'E', 'F' }; ! static const XML_Char atypeIDREFS[] = { 'I', 'D', 'R', 'E', 'F', 'S' }; ! static const XML_Char atypeENTITY[] = { 'E', 'N', 'T', 'I', 'T', 'Y' }; ! static const XML_Char atypeENTITIES[] = { 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S' }; ! static const XML_Char atypeNMTOKEN[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N' }; ! static const XML_Char atypeNMTOKENS[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S' }; ! static const XML_Char notationPrefix[] = { 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N', '(' }; ! static const XML_Char enumValueSep[] = { '|' }; ! static const XML_Char enumValueStart[] = { '(' }; ! const char **eventPP; --- 2592,2606 ---- static const XML_Char externalSubsetName[] = { '#' , '\0' }; #endif /* XML_DTD */ ! static const XML_Char atypeCDATA[] = { 'C', 'D', 'A', 'T', 'A', '\0' }; ! static const XML_Char atypeID[] = { 'I', 'D', '\0' }; ! static const XML_Char atypeIDREF[] = { 'I', 'D', 'R', 'E', 'F', '\0' }; ! static const XML_Char atypeIDREFS[] = { 'I', 'D', 'R', 'E', 'F', 'S', '\0' }; ! static const XML_Char atypeENTITY[] = { 'E', 'N', 'T', 'I', 'T', 'Y', '\0' }; ! static const XML_Char atypeENTITIES[] = { 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S', '\0' }; ! static const XML_Char atypeNMTOKEN[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', '\0' }; ! static const XML_Char atypeNMTOKENS[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S', '\0' }; ! static const XML_Char notationPrefix[] = { 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N', '(', '\0' }; ! static const XML_Char enumValueSep[] = { '|', '\0' }; ! static const XML_Char enumValueStart[] = { '(', '\0' }; const char **eventPP; From fdrake@acm.org Tue Apr 23 14:28:07 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue Apr 23 13:28:07 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.26,1.27 In-Reply-To: References: Message-ID: <15557.50073.9366.808420@grendel.zope.com> Karl Waclawek writes: > Log Message: > XML_UNICODE fixes Thanks, Karl! Could you close the bug reports & patches related to this, with any appropriate comments? -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@users.sourceforge.net Tue Apr 23 15:37:13 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue Apr 23 14:37:13 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.28,1.29 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv32020a/lib Modified Files: xmlparse.c Log Message: Squash compiler warning (GCC): simply referencing a variable in the initialization clause of a for statement does not have any effect. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** xmlparse.c 23 Apr 2002 19:48:29 -0000 1.28 --- xmlparse.c 23 Apr 2002 21:36:16 -0000 1.29 *************** *** 2128,2132 **** prefixLen = 0; if (ns && ns_triplets && binding->prefix->name) { ! for (prefixLen; binding->prefix->name[prefixLen++];) ; } --- 2128,2132 ---- prefixLen = 0; if (ns && ns_triplets && binding->prefix->name) { ! for (; binding->prefix->name[prefixLen++];) ; } From fdrake@users.sourceforge.net Tue Apr 23 21:37:08 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue Apr 23 20:37:08 2002 Subject: [Expat-checkins] CVS: expat/lib expat.h,1.16,1.17 xmlparse.c,1.29,1.30 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv15671/lib Modified Files: expat.h xmlparse.c Log Message: XML_ParserReset(): New function. Reset a parser to be used again, without having to incur memory allocation costs for subsequent parses. This closes SF patch #450608, contributed by David Crowley. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** expat.h 23 Apr 2002 13:48:50 -0000 1.16 --- expat.h 24 Apr 2002 03:36:23 -0000 1.17 *************** *** 179,182 **** --- 179,193 ---- const XML_Char *namespaceSeparator); + /* Prepare a parser object to be re-used. This is particularly + valuable when memory allocation overhead is disproportionatly high, + such as when a large number of small documnents need to be parsed. + All handlers are cleared from the parser. + + Added in Expat 1.95.3. + */ + + XMLPARSEAPI(void) + XML_ParserReset(XML_Parser parser, const XML_Char *encodingName); + /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** xmlparse.c 23 Apr 2002 21:36:16 -0000 1.29 --- xmlparse.c 24 Apr 2002 03:36:23 -0000 1.30 *************** *** 602,607 **** --- 602,658 ---- if (!parser) return parser; + + buffer = 0; + bufferLim = 0; + + attsSize = INIT_ATTS_SIZE; + atts = MALLOC(attsSize * sizeof(ATTRIBUTE)); + dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); + dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; + freeBindingList = 0; + inheritedBindings = 0; + freeTagList = 0; + + namespaceSeparator = '!'; + ns = 0; + ns_triplets = 0; + poolInit(&tempPool, &(((Parser *) parser)->m_mem)); + poolInit(&temp2Pool, &(((Parser *) parser)->m_mem)); + + XML_ParserReset(parser, encodingName); + + if (!dtdInit(&dtd, parser) || !atts || !dataBuf + || (encodingName && !protocolEncodingName)) { + XML_ParserFree(parser); + return 0; + } + + if (nameSep) { + ns = 1; + internalEncoding = XmlGetInternalEncodingNS(); + namespaceSeparator = *nameSep; + + if (! setContext(parser, implicitContext)) { + XML_ParserFree(parser); + return 0; + } + } + else { + internalEncoding = XmlGetInternalEncoding(); + } + + return parser; + } + + void XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) + { + processor = prologInitProcessor; XmlPrologStateInit(&prologState); + protocolEncodingName = (encodingName + ? poolCopyString(&tempPool, encodingName) + : 0); + curBase = 0; + XmlInitEncoding(&initEncoding, &encoding, 0); userData = 0; handlerArg = 0; *************** *** 628,637 **** entityDeclHandler = 0; xmlDeclHandler = 0; ! buffer = 0; ! bufferPtr = 0; ! bufferEnd = 0; parseEndByteIndex = 0; parseEndPtr = 0; - bufferLim = 0; declElementType = 0; declAttributeId = 0; --- 679,686 ---- entityDeclHandler = 0; xmlDeclHandler = 0; ! bufferPtr = buffer; ! bufferEnd = buffer; parseEndByteIndex = 0; parseEndPtr = 0; declElementType = 0; declAttributeId = 0; *************** *** 643,646 **** --- 692,697 ---- declNotationName = 0; declNotationPublicId = 0; + declAttributeIsCdata = 0; + declAttributeIsId = 0; memset(&position, 0, sizeof(POSITION)); errorCode = XML_ERROR_NONE; *************** *** 649,661 **** positionPtr = 0; openInternalEntities = 0; tagLevel = 0; tagStack = 0; - freeTagList = 0; - freeBindingList = 0; - inheritedBindings = 0; - attsSize = INIT_ATTS_SIZE; - atts = MALLOC(attsSize * sizeof(ATTRIBUTE)); nSpecifiedAtts = 0; - dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); groupSize = 0; groupConnector = 0; --- 700,707 ---- positionPtr = 0; openInternalEntities = 0; + defaultExpandInternalEntities = 0; tagLevel = 0; tagStack = 0; nSpecifiedAtts = 0; groupSize = 0; groupConnector = 0; *************** *** 665,706 **** unknownEncodingData = 0; unknownEncodingHandlerData = 0; - namespaceSeparator = '!'; #ifdef XML_DTD parentParser = 0; paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif ! ns = 0; ! ns_triplets = 0; ! poolInit(&tempPool, &(((Parser *) parser)->m_mem)); ! poolInit(&temp2Pool, &(((Parser *) parser)->m_mem)); ! protocolEncodingName = (encodingName ! ? poolCopyString(&tempPool, encodingName) ! : 0); ! curBase = 0; ! if (!dtdInit(&dtd, parser) || !atts || !dataBuf ! || (encodingName && !protocolEncodingName)) { ! XML_ParserFree(parser); ! return 0; ! } ! dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; ! ! if (nameSep) { ! XmlInitEncodingNS(&initEncoding, &encoding, 0); ! ns = 1; ! internalEncoding = XmlGetInternalEncodingNS(); ! namespaceSeparator = *nameSep; ! ! if (! setContext(parser, implicitContext)) { ! XML_ParserFree(parser); ! return 0; ! } ! } ! else { ! XmlInitEncoding(&initEncoding, &encoding, 0); ! internalEncoding = XmlGetInternalEncoding(); ! } ! ! return parser; ! } /* End XML_ParserCreate_MM */ int XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) --- 711,719 ---- unknownEncodingData = 0; unknownEncodingHandlerData = 0; #ifdef XML_DTD parentParser = 0; paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif ! } int XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) From fdrake@users.sourceforge.net Tue Apr 23 21:49:01 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue Apr 23 20:49:01 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.14,1.15 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv17692/tests Modified Files: runtests.c Log Message: Take advantage of XML_ParserReset(): Instead of creating new parsers in run_*_check(), reset the parser between uses in the one place its actually needed. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** runtests.c 22 Apr 2002 18:50:18 -0000 1.14 --- runtests.c 24 Apr 2002 03:48:03 -0000 1.15 *************** *** 176,183 **** { CharData storage; - XML_Parser parser = XML_ParserCreate(NULL); - - if (parser == NULL) - fail("Parser not created."); storage.count = -1; --- 176,179 ---- *************** *** 187,191 **** xml_failure(); check_characters(&storage, expected); - XML_ParserFree(parser); } --- 183,186 ---- *************** *** 194,201 **** { CharData storage; - XML_Parser parser = XML_ParserCreate(NULL); - - if (parser == NULL) - fail("Parser not created."); storage.count = -1; /* magical "not-set" value */ --- 189,192 ---- *************** *** 205,209 **** xml_failure(); check_characters(&storage, expected); - XML_ParserFree(parser); } --- 196,199 ---- *************** *** 316,319 **** --- 306,310 ---- "\xC3\xA4 \xC3\xB6 \xC3\xBC"; run_character_check(text, utf8); + XML_ParserReset(parser, NULL); run_attribute_check(text, utf8); } From fdrake@users.sourceforge.net Wed Apr 24 07:34:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed Apr 24 06:34:02 2002 Subject: [Expat-checkins] CVS: expat/win32 expat.iss,1.6,1.7 Message-ID: Update of /cvsroot/expat/expat/win32 In directory usw-pr-cvs1:/tmp/cvs-serv27550/win32 Modified Files: expat.iss Log Message: Bump version number. Index: expat.iss =================================================================== RCS file: /cvsroot/expat/expat/win32/expat.iss,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** expat.iss 27 Jul 2001 15:31:22 -0000 1.6 --- expat.iss 24 Apr 2002 13:10:09 -0000 1.7 *************** *** 7,19 **** AppName=expat AppId=expat ! AppVersion=1.95.2 ! AppVerName=expat 1.95.2 AppCopyright=Copyright © 1998-2001 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers ! DefaultDirName={sd}\Expat-1.95.2 AppPublisher=The Expat Developers AppPublisherURL=http://expat.sourceforge.net/ AppSupportURL=http://expat.sourceforge.net/ AppUpdatesURL=http://expat.sourceforge.net/ ! UninstallDisplayName=Expat XML Parser (version 1.95.2) UninstallFilesDir={app}\Uninstall --- 7,19 ---- AppName=expat AppId=expat ! AppVersion=1.95.3 ! AppVerName=expat 1.95.3 AppCopyright=Copyright © 1998-2001 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers ! DefaultDirName={sd}\Expat-1.95.3 AppPublisher=The Expat Developers AppPublisherURL=http://expat.sourceforge.net/ AppSupportURL=http://expat.sourceforge.net/ AppUpdatesURL=http://expat.sourceforge.net/ ! UninstallDisplayName=Expat XML Parser (version 1.95.3) UninstallFilesDir={app}\Uninstall *************** *** 30,33 **** --- 30,34 ---- CopyMode: alwaysoverwrite; Source: win32\MANIFEST.txt; DestDir: "{app}" CopyMode: alwaysoverwrite; Source: COPYING; DestDir: "{app}"; DestName: COPYING.txt + CopyMode: alwaysoverwrite; Source: NEWS; DestDir: "{app}"; DestName: NEWS.txt CopyMode: alwaysoverwrite; Source: README; DestDir: "{app}"; DestName: README.txt CopyMode: alwaysoverwrite; Source: doc\*.html; DestDir: "{app}\Doc" From fdrake@users.sourceforge.net Wed Apr 24 07:34:08 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed Apr 24 06:34:08 2002 Subject: [Expat-checkins] CVS: expat NEWS,NONE,1.1 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv27724 Added Files: NEWS Log Message: Added "NEWS" file for 1.95.3. Still needs to be filled in a bit. --- NEW FILE: NEWS --- Changes for Expat 1.95.3 Release date: 2002-Apr-XX -------------------------- * Added XML_ParserReset(), a new function which resets a parser without freeing memory pools. When parsing many small documents, this can make a performance improvement due to the avoided malloc() calls. Contributed by David Crowley as SF patch #450608. * Many changes to the build process to improve cross-platform support. * Fixed XML_SetReturnNSTriplet() to work for element names. * Fixed support for XML_UNICODE, allowing UTF-16 output to be usable. * Added several regression tests. * Added a Unix man page for xmlwf. * Allow xmlwf to read from standard input. From fdrake@users.sourceforge.net Wed Apr 24 19:43:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed Apr 24 18:43:02 2002 Subject: [Expat-checkins] CVS: expat/tests runtests.c,1.15,1.16 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv16991/tests Modified Files: runtests.c Log Message: Make the organization slightly easier to discern. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** runtests.c 24 Apr 2002 03:48:03 -0000 1.15 --- runtests.c 25 Apr 2002 01:42:34 -0000 1.16 *************** *** 45,48 **** --- 45,53 ---- #define xml_failure() _xml_failure(__FILE__, __LINE__) + + /* + * Character & encoding tests. + */ + START_TEST(test_nul_byte) { *************** *** 70,91 **** END_TEST - - START_TEST(test_xmldecl_misplaced) - { - char *text = - "\n" - "\n" - "&eee;"; - - if (!XML_Parse(parser, text, strlen(text), 1)) { - if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI) - xml_failure(); - } - else { - fail("expected XML_ERROR_MISPLACED_XML_PI with misplaced XML decl"); - } - } - END_TEST - START_TEST(test_bom_utf8) { --- 75,78 ---- *************** *** 312,315 **** --- 299,306 ---- + /* + * Attribute tests. + */ + /* Helpers used by the following test; this checks any "attr" and "refs" * attributes to make sure whitespace has been normalized. *************** *** 417,420 **** --- 408,433 ---- if (!XML_Parse(parser, text, strlen(text), 1)) xml_failure(); + } + END_TEST + + + /* + * XML declaration tests. + */ + + START_TEST(test_xmldecl_misplaced) + { + char *text = + "\n" + "\n" + "&eee;"; + + if (!XML_Parse(parser, text, strlen(text), 1)) { + if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI) + xml_failure(); + } + else { + fail("expected XML_ERROR_MISPLACED_XML_PI with misplaced XML decl"); + } } END_TEST From fdrake@users.sourceforge.net Wed Apr 24 22:05:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed Apr 24 21:05:02 2002 Subject: [Expat-checkins] CVS: expat/tests chardata.c,NONE,1.1 chardata.h,NONE,1.1 runtests.c,1.16,1.17 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv25688/tests Modified Files: runtests.c Added Files: chardata.c chardata.h Log Message: Revise the data accumulation to be at least a little separated from the actual test code. Not pretty & lacking in internal documentation, but allows the test code to be a bit more readable. --- NEW FILE: chardata.c --- /* chardata.c * * */ #include #include #include #include "chardata.h" static int xmlstrlen(const XML_Char *s) { int len = 0; while (s[len] != 0) ++len; return len; } void CharData_Init(CharData *storage) { storage->count = -1; } void CharData_AppendString(CharData *storage, const char *s) { int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); int len = strlen(s); if (storage->count < 0) storage->count = 0; if ((len + storage->count) > maxchars) { len = (maxchars - storage->count); } if (len + storage->count < sizeof(storage->data)) { memcpy(storage->data + storage->count, s, len); storage->count += len; } } void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) { int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); if (storage->count < 0) storage->count = 0; if (len < 0) len = xmlstrlen(s); if ((len + storage->count) > maxchars) { len = (maxchars - storage->count); } if (len + storage->count < sizeof(storage->data)) { memcpy(storage->data + storage->count, s, len * sizeof(storage->data[0])); storage->count += len; } } bool CharData_CheckString(CharData *storage, const char *expected) { char buffer[1024]; int len = strlen(expected); int count = (storage->count < 0) ? 0 : storage->count; if (len != count) { sprintf(buffer, "wrong number of data characters: got %d, expected %d", count, len); fail(buffer); return false; } if (memcmp(expected, storage->data, len) != 0) { fail("got bad data bytes"); return false; } return true; } bool CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) { char buffer[1024]; int len = strlen(expected); int count = (storage->count < 0) ? 0 : storage->count; if (len != count) { sprintf(buffer, "wrong number of data characters: got %d, expected %d", count, len); fail(buffer); return false; } if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) { fail("got bad data bytes"); return false; } return true; } --- NEW FILE: chardata.h --- /* chardata.h * * */ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1 #ifndef XML_VERSION #include "expat.h" /* need XML_Char */ #endif #include typedef struct { int count; /* # of chars, < 0 if not set */ XML_Char data[1024]; } CharData; void CharData_Init(CharData *storage); void CharData_AppendString(CharData *storage, const char *s); void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len); bool CharData_CheckString(CharData *storage, const char *s); bool CharData_CheckXMLChars(CharData *storage, const XML_Char *s); #endif /* XML_CHARDATA_H */ Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** runtests.c 25 Apr 2002 01:42:34 -0000 1.16 --- runtests.c 25 Apr 2002 04:04:42 -0000 1.17 *************** *** 6,9 **** --- 6,10 ---- #include "expat.h" + #include "chardata.h" *************** *** 103,124 **** END_TEST - - typedef struct - { - int count; /* # of chars, < 0 if not set */ - XML_Char data[1024]; - } CharData; - static void accumulate_characters(void *userData, const XML_Char *s, int len) { ! CharData *storage = (CharData *)userData; ! if (storage->count < 0) ! storage->count = 0; ! if (len + storage->count < sizeof(storage->data)) { ! memcpy(storage->data + storage->count, s, ! len * sizeof(storage->data[0])); ! storage->count += len; ! } } --- 104,111 ---- END_TEST static void accumulate_characters(void *userData, const XML_Char *s, int len) { ! CharData_AppendXMLChars((CharData *)userData, s, len); } *************** *** 130,161 **** if (storage->count < 0 && atts != NULL && atts[0] != NULL) { /* "accumulate" the value of the first attribute we see */ ! int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); ! int i; ! for (i = 0; i < maxchars; ++i) { ! XML_Char ch = atts[1][i]; ! if (ch == 0) ! break; ! storage->data[i] = ch; ! } ! storage->count = i; } } - static void - check_characters(CharData *storage, XML_Char *expected) - { - char buffer[1024]; - int len = strlen(expected); - if (storage->count < 0) - storage->count = 0; - if (len != storage->count) { - sprintf(buffer, "wrong number of data characters: got %d, expected %d", - storage->count, len); - fail(buffer); - return; - } - if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) - fail("got bad data bytes"); - } static void --- 117,124 ---- if (storage->count < 0 && atts != NULL && atts[0] != NULL) { /* "accumulate" the value of the first attribute we see */ ! CharData_AppendXMLChars(storage, atts[1], -1); } } static void *************** *** 164,173 **** CharData storage; ! storage.count = -1; XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); if (!XML_Parse(parser, text, strlen(text), 1)) xml_failure(); ! check_characters(&storage, expected); } --- 127,136 ---- CharData storage; ! CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); if (!XML_Parse(parser, text, strlen(text), 1)) xml_failure(); ! CharData_CheckXMLChars(&storage, expected); } *************** *** 177,186 **** CharData storage; ! storage.count = -1; /* magical "not-set" value */ XML_SetUserData(parser, &storage); XML_SetStartElementHandler(parser, accumulate_attribute); if (!XML_Parse(parser, text, strlen(text), 1)) xml_failure(); ! check_characters(&storage, expected); } --- 140,149 ---- CharData storage; ! CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetStartElementHandler(parser, accumulate_attribute); if (!XML_Parse(parser, text, strlen(text), 1)) xml_failure(); ! CharData_CheckXMLChars(&storage, expected); } From fdrake@users.sourceforge.net Wed Apr 24 22:05:03 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed Apr 24 21:05:03 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.26,1.27 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv25688 Modified Files: Makefile.in Log Message: Revise the data accumulation to be at least a little separated from the actual test code. Not pretty & lacking in internal documentation, but allows the test code to be a bit more readable. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Makefile.in 22 Apr 2002 17:04:36 -0000 1.26 --- Makefile.in 25 Apr 2002 04:04:42 -0000 1.27 *************** *** 146,152 **** $(LINK_EXE) $< lib/$(LIBRARY) ! tests/runtests.o: tests/runtests.c ! tests/runtests: tests/runtests.o lib/$(LIBRARY) ! $(LINK_EXE) $< lib/$(LIBRARY) -lcheck .SUFFIXES: .c .lo .o --- 146,153 ---- $(LINK_EXE) $< lib/$(LIBRARY) ! tests/chardata.o: tests/chardata.c tests/chardata.h ! tests/runtests.o: tests/runtests.c tests/chardata.h ! tests/runtests: tests/runtests.o tests/chardata.o lib/$(LIBRARY) ! $(LINK_EXE) $^ -lcheck .SUFFIXES: .c .lo .o From fdrake@users.sourceforge.net Thu Apr 25 22:47:05 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu Apr 25 21:47:05 2002 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.30,1.31 xmltok.c,1.7,1.8 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv29880 Modified Files: xmlparse.c xmltok.c Log Message: Cut down on the warnings from MSVC6 on Warning Level 4. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** xmlparse.c 24 Apr 2002 03:36:23 -0000 1.30 --- xmlparse.c 26 Apr 2002 04:46:24 -0000 1.31 *************** *** 3831,3835 **** att->id = attId; att->value = value; ! att->isCdata = isCdata; if (!isCdata) attId->maybeTokenized = 1; --- 3831,3835 ---- att->id = attId; att->value = value; ! att->isCdata = (char)isCdata; if (!isCdata) attId->maybeTokenized = 1; Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xmltok.c 25 Jul 2001 17:18:43 -0000 1.7 --- xmltok.c 26 Apr 2002 04:46:24 -0000 1.8 *************** *** 294,302 **** switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { case BT_LEAD2: ! *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f); from += 2; break; case BT_LEAD3: ! *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f); from += 3; break; --- 294,302 ---- switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { case BT_LEAD2: ! *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f)); from += 2; break; case BT_LEAD3: ! *to++ = (unsigned short)(((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); from += 3; break; *************** *** 382,387 **** if (toLim - *toP < 2) break; ! *(*toP)++ = ((c >> 6) | UTF8_cval2); ! *(*toP)++ = ((c & 0x3f) | 0x80); (*fromP)++; } --- 382,387 ---- if (toLim - *toP < 2) break; ! *(*toP)++ = (char)((c >> 6) | UTF8_cval2); ! *(*toP)++ = (char)((c & 0x3f) | 0x80); (*fromP)++; } *************** *** 974,978 **** return 0; } ! open = c; ptr += enc->minBytesPerChar; *valPtr = ptr; --- 974,978 ---- return 0; } ! open = (char)c; ptr += enc->minBytesPerChar; *valPtr = ptr; *************** *** 1136,1158 **** return 0; if (c < min2) { ! buf[0] = (c | UTF8_cval1); return 1; } if (c < min3) { ! buf[0] = ((c >> 6) | UTF8_cval2); ! buf[1] = ((c & 0x3f) | 0x80); return 2; } if (c < min4) { ! buf[0] = ((c >> 12) | UTF8_cval3); ! buf[1] = (((c >> 6) & 0x3f) | 0x80); ! buf[2] = ((c & 0x3f) | 0x80); return 3; } if (c < 0x110000) { ! buf[0] = ((c >> 18) | UTF8_cval4); ! buf[1] = (((c >> 12) & 0x3f) | 0x80); ! buf[2] = (((c >> 6) & 0x3f) | 0x80); ! buf[3] = ((c & 0x3f) | 0x80); return 4; } --- 1136,1158 ---- return 0; if (c < min2) { ! buf[0] = (char)(c | UTF8_cval1); return 1; } if (c < min3) { ! buf[0] = (char)((c >> 6) | UTF8_cval2); ! buf[1] = (char)((c & 0x3f) | 0x80); return 2; } if (c < min4) { ! buf[0] = (char)((c >> 12) | UTF8_cval3); ! buf[1] = (char)(((c >> 6) & 0x3f) | 0x80); ! buf[2] = (char)((c & 0x3f) | 0x80); return 3; } if (c < 0x110000) { ! buf[0] = (char)((c >> 18) | UTF8_cval4); ! buf[1] = (char)(((c >> 12) & 0x3f) | 0x80); ! buf[2] = (char)(((c >> 6) & 0x3f) | 0x80); ! buf[3] = (char)((c & 0x3f) | 0x80); return 4; } *************** *** 1165,1175 **** return 0; if (charNum < 0x10000) { ! buf[0] = charNum; return 1; } if (charNum < 0x110000) { charNum -= 0x10000; ! buf[0] = (charNum >> 10) + 0xD800; ! buf[1] = (charNum & 0x3FF) + 0xDC00; return 2; } --- 1165,1175 ---- return 0; if (charNum < 0x10000) { ! buf[0] = (unsigned short)charNum; return 1; } if (charNum < 0x110000) { charNum -= 0x10000; ! buf[0] = (unsigned short)((charNum >> 10) + 0xD800); ! buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00); return 2; } *************** *** 1299,1303 **** if (c < -4) return 0; ! e->normal.type[i] = BT_LEAD2 - (c + 2); e->utf8[i][0] = 0; e->utf16[i] = 0; --- 1299,1303 ---- if (c < -4) return 0; ! e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2)); e->utf8[i][0] = 0; e->utf16[i] = 0; *************** *** 1311,1315 **** e->utf8[i][0] = 1; e->utf8[i][1] = (char)c; ! e->utf16[i] = c == 0 ? 0xFFFF : c; } else if (checkCharRefNumber(c) < 0) { --- 1311,1315 ---- e->utf8[i][0] = 1; e->utf8[i][1] = (char)c; ! e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c); } else if (checkCharRefNumber(c) < 0) { *************** *** 1330,1334 **** e->normal.type[i] = BT_OTHER; e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); ! e->utf16[i] = c; } } --- 1330,1334 ---- e->normal.type[i] = BT_OTHER; e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); ! e->utf16[i] = (unsigned short)c; } } From fdrake@users.sourceforge.net Thu Apr 25 23:15:02 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu Apr 25 22:15:02 2002 Subject: [Expat-checkins] CVS: expat/lib xmltok.c,1.8,1.9 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv2166/lib Modified Files: xmltok.c Log Message: Wrap some long lines, including ones I just introduced. There ought to be a good way to use a real editor with MSCV! Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** xmltok.c 26 Apr 2002 04:46:24 -0000 1.8 --- xmltok.c 26 Apr 2002 05:14:20 -0000 1.9 *************** *** 298,302 **** break; case BT_LEAD3: ! *to++ = (unsigned short)(((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); from += 3; break; --- 298,303 ---- break; case BT_LEAD3: ! *to++ = (unsigned short)(((from[0] & 0xf) << 12) ! | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); from += 3; break; *************** *** 306,310 **** if (to + 1 == toLim) break; ! n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); n -= 0x10000; to[0] = (unsigned short)((n >> 10) | 0xD800); --- 307,312 ---- if (to + 1 == toLim) break; ! n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) ! | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); n -= 0x10000; to[0] = (unsigned short)((n >> 10) | 0xD800); *************** *** 1004,1008 **** static const char KW_standalone[] = { ! ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, ASCII_n, ASCII_e, '\0' }; --- 1006,1011 ---- static const char KW_standalone[] = { ! ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, ! ASCII_n, ASCII_e, '\0' }; *************** *** 1035,1039 **** ptr += 5 * enc->minBytesPerChar; end -= 2 * enc->minBytesPerChar; ! if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) || !name) { *badPtr = ptr; return 0; --- 1038,1043 ---- ptr += 5 * enc->minBytesPerChar; end -= 2 * enc->minBytesPerChar; ! if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) ! || !name) { *badPtr = ptr; return 0; *************** *** 1080,1084 **** return 1; } ! if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) || isGeneralTextEntity) { *badPtr = name; return 0; --- 1084,1089 ---- return 1; } ! if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) ! || isGeneralTextEntity) { *badPtr = name; return 0; *************** *** 1233,1237 **** if (n == 0) { int c = ((const struct unknown_encoding *)enc) ! ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); n = XmlUtf8Encode(c, buf); if (n > toLim - *toP) --- 1238,1243 ---- if (n == 0) { int c = ((const struct unknown_encoding *)enc) ! ->convert(((const struct unknown_encoding *)enc)->userData, ! *fromP); n = XmlUtf8Encode(c, buf); if (n > toLim - *toP) *************** *** 1366,1373 **** static const char KW_ISO_8859_1[] = { ! ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, ASCII_MINUS, ASCII_1, '\0' }; static const char KW_US_ASCII[] = { ! ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, '\0' }; static const char KW_UTF_8[] = { --- 1372,1381 ---- static const char KW_ISO_8859_1[] = { ! ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, ! ASCII_MINUS, ASCII_1, '\0' }; static const char KW_US_ASCII[] = { ! ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, ! '\0' }; static const char KW_UTF_8[] = { *************** *** 1378,1385 **** }; static const char KW_UTF_16BE[] = { ! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, '\0' }; static const char KW_UTF_16LE[] = { ! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, '\0' }; --- 1386,1395 ---- }; static const char KW_UTF_16BE[] = { ! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, ! '\0' }; static const char KW_UTF_16LE[] = { ! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, ! '\0' }; *************** *** 1404,1418 **** } ! /* For binary compatibility, we store the index of the encoding specified ! at initialization in the isUtf16 member. */ #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) ! /* This is what detects the encoding. ! encodingTable maps from encoding indices to encodings; ! INIT_ENC_INDEX(enc) is the index of the external (protocol) specified encoding; ! state is XML_CONTENT_STATE if we're parsing an external text entity, ! and XML_PROLOG_STATE otherwise. */ --- 1414,1429 ---- } ! /* For binary compatibility, we store the index of the encoding ! specified at initialization in the isUtf16 member. ! */ #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) ! /* This is what detects the encoding. encodingTable maps from ! encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of ! the external (protocol) specified encoding; state is ! XML_CONTENT_STATE if we're parsing an external text entity, and ! XML_PROLOG_STATE otherwise. */ *************** *** 1492,1496 **** if (state == XML_CONTENT_STATE) { int e = INIT_ENC_INDEX(enc); ! if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC || e == UTF_16LE_ENC || e == UTF_16_ENC) break; } --- 1503,1508 ---- if (state == XML_CONTENT_STATE) { int e = INIT_ENC_INDEX(enc); ! if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC ! || e == UTF_16LE_ENC || e == UTF_16_ENC) break; } *************** *** 1505,1512 **** default: if (ptr[0] == '\0') { ! /* 0 isn't a legal data character. Furthermore a document entity can only ! start with ASCII characters. So the only way this can fail to be big-endian ! UTF-16 if it it's an external parsed general entity that's labelled as ! UTF-16LE. */ if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) break; --- 1517,1526 ---- default: if (ptr[0] == '\0') { ! /* 0 isn't a legal data character. Furthermore a document ! entity can only start with ASCII characters. So the only ! way this can fail to be big-endian UTF-16 if it it's an ! external parsed general entity that's labelled as ! UTF-16LE. ! */ if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) break; From fdrake@users.sourceforge.net Mon Apr 29 12:06:39 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 29 11:06:39 2002 Subject: [Expat-checkins] CVS: expat/tests chardata.c,1.1,1.2 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv20845/tests Modified Files: chardata.c Log Message: Added a bunch of assertions that internal assumptions are not violated (specifically, make sure args are not NULL). If the expected value is not the right length, include the value found in the error message, to make problems easier to diagnose. Index: chardata.c =================================================================== RCS file: /cvsroot/expat/expat/tests/chardata.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chardata.c 25 Apr 2002 04:04:42 -0000 1.1 --- chardata.c 29 Apr 2002 17:09:31 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- */ + #include #include #include *************** *** 14,17 **** --- 15,19 ---- xmlstrlen(const XML_Char *s) { + assert(s != NULL); int len = 0; while (s[len] != 0) *************** *** 24,27 **** --- 26,30 ---- CharData_Init(CharData *storage) { + assert(storage != NULL); storage->count = -1; } *************** *** 31,36 **** { int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); ! int len = strlen(s); if (storage->count < 0) storage->count = 0; --- 34,41 ---- { int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); ! int len; + assert(s != NULL); + len = strlen(s); if (storage->count < 0) storage->count = 0; *************** *** 47,52 **** CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) { ! int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); if (storage->count < 0) storage->count = 0; --- 52,60 ---- CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) { ! int maxchars; + assert(storage != NULL); + assert(s != NULL); + maxchars = sizeof(storage->data) / sizeof(storage->data[0]); if (storage->count < 0) storage->count = 0; *************** *** 66,76 **** CharData_CheckString(CharData *storage, const char *expected) { ! char buffer[1024]; ! int len = strlen(expected); ! int count = (storage->count < 0) ? 0 : storage->count; if (len != count) { ! sprintf(buffer, "wrong number of data characters: got %d, expected %d", ! count, len); fail(buffer); return false; --- 74,93 ---- CharData_CheckString(CharData *storage, const char *expected) { ! char buffer[1280]; ! int len; ! int count; + assert(storage != NULL); + assert(expected != NULL); + count = (storage->count < 0) ? 0 : storage->count; + len = strlen(expected); if (len != count) { ! if (sizeof(XML_Char) == 1) ! sprintf(buffer, "wrong number of data characters:" ! " got %d, expected %d:\n%s", count, len, storage->data); ! else ! sprintf(buffer, ! "wrong number of data characters: got %d, expected %d", ! count, len); fail(buffer); return false; *************** *** 87,93 **** { char buffer[1024]; ! int len = strlen(expected); ! int count = (storage->count < 0) ? 0 : storage->count; if (len != count) { sprintf(buffer, "wrong number of data characters: got %d, expected %d", --- 104,112 ---- { char buffer[1024]; ! int len = xmlstrlen(expected); ! int count; + assert(storage != NULL); + count = (storage->count < 0) ? 0 : storage->count; if (len != count) { sprintf(buffer, "wrong number of data characters: got %d, expected %d", From fdrake@users.sourceforge.net Mon Apr 29 12:07:27 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 29 11:07:27 2002 Subject: [Expat-checkins] CVS: expat/tests chardata.c,1.2,1.3 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv21163/tests Modified Files: chardata.c Log Message: Fix stupid last minute change. Index: chardata.c =================================================================== RCS file: /cvsroot/expat/expat/tests/chardata.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** chardata.c 29 Apr 2002 17:09:31 -0000 1.2 --- chardata.c 29 Apr 2002 17:10:26 -0000 1.3 *************** *** 15,20 **** xmlstrlen(const XML_Char *s) { - assert(s != NULL); int len = 0; while (s[len] != 0) ++len; --- 15,20 ---- xmlstrlen(const XML_Char *s) { int len = 0; + assert(s != NULL); while (s[len] != 0) ++len; From fdrake@users.sourceforge.net Mon Apr 29 15:32:06 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 29 14:32:06 2002 Subject: [Expat-checkins] CVS: expat/tests xmltest.sh,NONE,1.1 .cvsignore,1.2,1.3 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv21155/tests Modified Files: .cvsignore Added Files: xmltest.sh Log Message: Added target to run checks based on xmlwf and James Clark's test cases. This is not run by "make check" since it requires unzip, wget, and network access to set up the tests. Use "make run-xmltext" to run the tests. --- NEW FILE: xmltest.sh --- #! /bin/sh VERBOSE='' if [ "$1" = '-v' -o "$1" = '--verbose' ] ; then VERBOSE="$1" shift fi if [ ! "$1" = '' ] ; then ERRORS=0 if [ "$VERBOSE" ] ; then OUTPUT="/tmp/$$.out" else OUTPUT="/dev/null" fi while [ "$1" ] ; do FILE="`basename \"$1\"`" DIR="`dirname \"$1\"`" DIR="`dirname \"$DIR\"`" ../xmlwf/xmlwf -d /tmp "$DIR/$FILE" diff -u "$DIR/out/$FILE" "/tmp/$FILE" >$OUTPUT ERR=$? rm "/tmp/$FILE" if [ ! "$ERR" = 0 ] ; then ERRORS=`expr $ERRORS + 1` echo "$DIR/$FILE ... Error" cat $OUTPUT elif [ "$VERBOSE" ] ; then echo "$DIR/$FILE ... Ok" fi shift done if [ "$VERBOSE" ] ; then rm $OUTPUT fi if [ ! "$ERRORS" = '0' ] ; then echo " Errors: $ERRORS" exit 1 fi else SCRIPTDIR="`dirname \"$0\"`" cd "$SCRIPTDIR" find xmltest -name \*.xml | grep /out/ | xargs ./xmltest.sh $VERBOSE if [ ! "$?" = "0" ] ; then exit 1 fi fi Index: .cvsignore =================================================================== RCS file: /cvsroot/expat/expat/tests/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 7 Dec 2001 10:19:31 -0000 1.2 --- .cvsignore 29 Apr 2002 21:31:18 -0000 1.3 *************** *** 1,3 **** --- 1,5 ---- Makefile runtests + xmltest + xmltest.zip .libs From fdrake@users.sourceforge.net Mon Apr 29 15:32:07 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Apr 29 14:32:07 2002 Subject: [Expat-checkins] CVS: expat Makefile.in,1.27,1.28 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv21155 Modified Files: Makefile.in Log Message: Added target to run checks based on xmlwf and James Clark's test cases. This is not run by "make check" since it requires unzip, wget, and network access to set up the tests. Use "make run-xmltext" to run the tests. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Makefile.in 25 Apr 2002 04:04:42 -0000 1.27 --- Makefile.in 29 Apr 2002 21:31:18 -0000 1.28 *************** *** 151,154 **** --- 151,163 ---- $(LINK_EXE) $^ -lcheck + tests/xmltest.zip: + cd tests && wget ftp://ftp.jclark.com/pub/xml/xmltest.zip + + tests/xmltest: tests/xmltest.zip + cd tests && unzip -q xmltest.zip + + run-xmltest: xmlwf/xmlwf tests/xmltest + tests/xmltest.sh + .SUFFIXES: .c .lo .o From qu.duan@qwest.com Tue Apr 30 13:38:29 2002 From: qu.duan@qwest.com (Duan, Qu X) Date: Tue Apr 30 12:38:29 2002 Subject: [Expat-checkins] an architecture question Message-ID: <49F78F5E3F07D511818200508B5C785106ACAFBE@BALNTEX001.qwest.net> Hi, High hand, I have been successfully use the library to parse and process xml file in text format. But I am a new to XML based distributed application. I want to know if we can output the result from apache server cgi-bin module, and remote xml client ( not a browser) can get it through connect with http server? How many components is missing here? For HTML data, nad use browser as client, we just need set content type, print to stdout, the browser will get it. But if use xml out put , it failed, says, mal-formed header. Any suggest? Thank you very much. River