From noreply at sourceforge.net Tue May 3 21:59:29 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue, 03 May 2005 12:59:29 -0700 Subject: [Expat-bugs] [ expat-Bugs-1190887 ] bad charset mangement in DTD Message-ID: Bugs item #1190887, was opened at 2005-04-27 05:57 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190887&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: bad charset mangement in DTD Initial Comment: Run the example hereafter you will have this message : not well-formed (invalid token) (line 1, offset 17) The char "?" is in ISO-8859-1but expat doesn't like it. e-mail : lemathias at gmail.com #include #include "expat.h" #include #include #include #include static int XMLCALL test(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId) { char *text = (char *)XML_GetUserData(parser); XML_Parser extparser; extparser = XML_ExternalEntityParserCreate(parser, context, NULL); if (extparser == NULL) { fprintf(stderr, "fine\n"); return 0; } if ( XML_Parse(extparser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR) { fprintf(stderr,"%s (line %d, offset %d)\n", XML_ErrorString(XML_GetErrorCode(extparser)), XML_GetCurrentLineNumber(extparser), XML_GetCurrentColumnNumber(extparser)); return XML_STATUS_ERROR; } return XML_STATUS_OK; } int main(int argc, char *argv[]) { char *text = "\n" "\n" "&entity;"; char *foo_text = ""; /* "?" is in the ISO-8859-1 charset */ XML_Parser parser = XML_ParserCreate(NULL); if (parser == NULL) { return 0; } XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); XML_SetUserData(parser, foo_text); XML_SetExternalEntityRefHandler(parser, test); if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_OK) { fprintf(stderr, "fine\n"); return 0; } if (XML_GetErrorCode(parser) != XML_ERROR_UNDEFINED_ENTITY) { fprintf(stderr, "fine\n"); return 0; } return 1; } ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-05-03 15:59 Message: Logged In: YES user_id=290026 The DTD contained in foo_text is an external entity. As such it is treated separately (it does not inherit the document entity's encoding declaration). You need to add an XML declaration with the appriopriate encoding to foo_text, and your program should work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190887&group_id=10127 From noreply at sourceforge.net Thu May 5 22:26:25 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 05 May 2005 13:26:25 -0700 Subject: [Expat-bugs] [ expat-Bugs-1196180 ] Error durring Make under Solaris 9 Message-ID: Bugs item #1196180, was opened at 2005-05-05 13:26 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1196180&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error durring Make under Solaris 9 Initial Comment: I am getting the following error during the make. I am running SOlaris 9 with gcc ver 3.1 bash-2.05# make /bin/bash ./libtool --silent --mode=link gcc -g -O2 -Wall - Wmissing-prototypes -Wstrict-prototypes -fexceptions - DHAVE_EXPAT_CONFIG_H -I./lib -I. -no-undefined - version-info 5:0:5 -rpath /usr/local/lib -o libexpat.la lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo Undefined first referenced symbol in file __eprintf lib/xmlparse.lo ld: fatal: Symbol referencing errors. No output written to .libs/libexpat.so.0.5.0 make: *** [libexpat.la] Error 1 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1196180&group_id=10127