From noreply at sourceforge.net Sun Apr 3 04:54:12 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Apr 3 04:54:15 2005 Subject: [Expat-bugs] [ expat-Bugs-1157018 ] not well-formed ( invalid token) for Certain XML tags Message-ID: Bugs item #1157018, was opened at 2005-03-04 14:56 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 Category: XML::Parser (inactive) Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: not well-formed ( invalid token) for Certain XML tags Initial Comment: Hello : I have a well formed XML packet but xmlwf thows out error on certain tags adad.dadad test There are lot of other tags before and after these tags ( as shown above ). If i remove this particular section the xmlwf doesn;t show any error. The exact error is :10 : not well-formed (invalid token) 10 is actually the column position. and in the lines shown above , "=" is in the column position 10. Is there any newer version that handles these kind of tags ? or pl. suggest me a work around ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-02 18:54 Message: Logged In: NO hello, i am new to using xml parsers in C. i have been playing with expat on a windows machine running cygwin and a gcc compiler. The version i am using is 1.95.8. i have written a code which i think is ok as its parsing the document ok to certain extent only.its giving a invalid token error.i am attachig the code and the contents of the xml file if any one would point me to wher i might be making a mistake i would really appreciate it. the code is below /***************************************************************** * This program reads from an xml file and builds a tree that is later used to populate the array structure of nics, cabs etc */ #include #include #include "expat.h" #define BUFFSIZE 18192 char Buff[BUFFSIZE]; int Depth; struct node{ char *node_name; //name of the node char **attr_name; //string list of attribute name char **attr_val; //array of values of the attributes char *text; //text that is associated with this node struct node **child; //array of children that this node can have struct node *parent; //pointer to the parent of the current node int child_no; }; /* This handler is called when ever a start tag is encountered in the input stream */ static void XMLCALL start(void *userData, const char *el, const char **attr) { struct node **temp_ptr = (struct node**)userData; printf("i am in start\n"); add_node(temp_ptr, el); } /* This handler is called when ever an end tag is encountered in the input stream */ static void XMLCALL end(void *userData, const char *el) { printf("i am in end\n"); struct node **temp_ptr = (struct node**)userData; close_node(temp_ptr); } /* This handler is called when ever a character tag is encountered in the input stream */ static void XMLCALL char_handle(void *userData, const XML_Char *s, int len){ char *data = (char *)s ; // pointer to the new string that we construct char *temp_data; int i = len; struct node **temp_ptr = (struct node**)userData; if (len >1) { while(i>0){ *temp_data = *data; i--; data++; temp_data++; } *temp_data = '\0'; temp_data = temp_data - len; printf("i am in char handle %s and len=%d\n", temp_data,len); } add_text(temp_ptr,data); } void add_node(struct node **void_node_ptr, char *el ){ struct node* next_node_ptr = (struct node*)malloc(sizeof (struct node*)); next_node_ptr->child_no = 0; struct node *current_node_ptr = (struct node *) *void_node_ptr; // update the previous node with the address of the current node // current_node_ptr->child[current_node_ptr- >child_no] = next_node_ptr; //current_node_ptr->child_no++; next_node_ptr->node_name = el; next_node_ptr->parent = current_node_ptr; current_node_ptr = next_node_ptr; } void add_text(struct node **void_node_ptr,char *data ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr->text = data; //printf(" in add_text with %s", current_node_ptr- >text); } void close_node(struct node **void_node_ptr ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr = current_node_ptr->parent; } void main(int argc, char *argv[]){ printf("i am in main\n"); XML_Parser p = XML_ParserCreate(NULL); if (! p) { fprintf(stderr, "Couldn't allocate memory for parser\n"); exit(-1); } //char *testdata = "venu\0"; struct node *node_ptr = (struct node*)malloc(sizeof(struct node*)); node_ptr->child_no = 0; //struct node *current_node_ptr = node_ptr; void *userData = (void *)node_ptr; XML_SetElementHandler(p, start, end); XML_SetCharacterDataHandler(p,char_handle); XML_SetUserData(p, &userData); FILE *fp; int len; int done=1; fp = fopen("/cygdrive/c/master-project/C- programming/test2.xml", "r"); len = fread(Buff, 1, BUFFSIZE, fp); printf("bytes read are %d and buffer has %d\n", len,sizeof (Buff)); fclose(fp); //printf("i am here"); if (XML_Parse(p,Buff,len,done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); exit(-1); } } The contents of the file are kkkk pppp thanks venu ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-03-13 05:56 Message: Logged In: YES user_id=290026 Show us your code - you may have a problem there. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 15:02 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 15:01 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 From noreply at sourceforge.net Sun Apr 3 04:59:35 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Apr 3 04:59:38 2005 Subject: [Expat-bugs] [ expat-Bugs-1175611 ] invalid token parse error Message-ID: Bugs item #1175611, was opened at 2005-04-02 18:59 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=1175611&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: invalid token parse error Initial Comment: hello, i am new to using xml parsers in C. i have been playing with expat on a windows machine running cygwin and a gcc compiler. The version i am using is 1.95.8. i have written a code which i think is ok as its parsing the document ok but to certain extent only.its giving a invalid token error.i am attachig the code and the contents of the xml file if any one would point me to wher i might be making a mistake, i would really appreciate it. the code is attached, the contents of the file are kkkk pppp i am pasting the contents of the file above as the form allows to upload only one file any help would be really appreciated. Thanks venu ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1175611&group_id=10127 From noreply at sourceforge.net Sun Apr 3 05:46:05 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Apr 3 05:46:08 2005 Subject: [Expat-bugs] [ expat-Bugs-1157018 ] not well-formed ( invalid token) for Certain XML tags Message-ID: Bugs item #1157018, was opened at 2005-03-04 17:56 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 Category: XML::Parser (inactive) Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: not well-formed ( invalid token) for Certain XML tags Initial Comment: Hello : I have a well formed XML packet but xmlwf thows out error on certain tags adad.dadad test There are lot of other tags before and after these tags ( as shown above ). If i remove this particular section the xmlwf doesn;t show any error. The exact error is :10 : not well-formed (invalid token) 10 is actually the column position. and in the lines shown above , "=" is in the column position 10. Is there any newer version that handles these kind of tags ? or pl. suggest me a work around ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-02 22:46 Message: Logged In: YES user_id=290026 Your main parsing code looks OK, although normally one would use a loop, but in your case it seems the whole file fits into the buffer. However, in your character data handler you are copying to temp_data, which is never allocated. Haven't looked at the other call-backs. You should also be aware that the character data between element tags can be reported through more than one call-back, so you need to buffer them and wait for the end-element call-back before null-terminating them. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-02 21:54 Message: Logged In: NO hello, i am new to using xml parsers in C. i have been playing with expat on a windows machine running cygwin and a gcc compiler. The version i am using is 1.95.8. i have written a code which i think is ok as its parsing the document ok to certain extent only.its giving a invalid token error.i am attachig the code and the contents of the xml file if any one would point me to wher i might be making a mistake i would really appreciate it. the code is below /***************************************************************** * This program reads from an xml file and builds a tree that is later used to populate the array structure of nics, cabs etc */ #include #include #include "expat.h" #define BUFFSIZE 18192 char Buff[BUFFSIZE]; int Depth; struct node{ char *node_name; //name of the node char **attr_name; //string list of attribute name char **attr_val; //array of values of the attributes char *text; //text that is associated with this node struct node **child; //array of children that this node can have struct node *parent; //pointer to the parent of the current node int child_no; }; /* This handler is called when ever a start tag is encountered in the input stream */ static void XMLCALL start(void *userData, const char *el, const char **attr) { struct node **temp_ptr = (struct node**)userData; printf("i am in start\n"); add_node(temp_ptr, el); } /* This handler is called when ever an end tag is encountered in the input stream */ static void XMLCALL end(void *userData, const char *el) { printf("i am in end\n"); struct node **temp_ptr = (struct node**)userData; close_node(temp_ptr); } /* This handler is called when ever a character tag is encountered in the input stream */ static void XMLCALL char_handle(void *userData, const XML_Char *s, int len){ char *data = (char *)s ; // pointer to the new string that we construct char *temp_data; int i = len; struct node **temp_ptr = (struct node**)userData; if (len >1) { while(i>0){ *temp_data = *data; i--; data++; temp_data++; } *temp_data = '\0'; temp_data = temp_data - len; printf("i am in char handle %s and len=%d\n", temp_data,len); } add_text(temp_ptr,data); } void add_node(struct node **void_node_ptr, char *el ){ struct node* next_node_ptr = (struct node*)malloc(sizeof (struct node*)); next_node_ptr->child_no = 0; struct node *current_node_ptr = (struct node *) *void_node_ptr; // update the previous node with the address of the current node // current_node_ptr->child[current_node_ptr- >child_no] = next_node_ptr; //current_node_ptr->child_no++; next_node_ptr->node_name = el; next_node_ptr->parent = current_node_ptr; current_node_ptr = next_node_ptr; } void add_text(struct node **void_node_ptr,char *data ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr->text = data; //printf(" in add_text with %s", current_node_ptr- >text); } void close_node(struct node **void_node_ptr ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr = current_node_ptr->parent; } void main(int argc, char *argv[]){ printf("i am in main\n"); XML_Parser p = XML_ParserCreate(NULL); if (! p) { fprintf(stderr, "Couldn't allocate memory for parser\n"); exit(-1); } //char *testdata = "venu\0"; struct node *node_ptr = (struct node*)malloc(sizeof(struct node*)); node_ptr->child_no = 0; //struct node *current_node_ptr = node_ptr; void *userData = (void *)node_ptr; XML_SetElementHandler(p, start, end); XML_SetCharacterDataHandler(p,char_handle); XML_SetUserData(p, &userData); FILE *fp; int len; int done=1; fp = fopen("/cygdrive/c/master-project/C- programming/test2.xml", "r"); len = fread(Buff, 1, BUFFSIZE, fp); printf("bytes read are %d and buffer has %d\n", len,sizeof (Buff)); fclose(fp); //printf("i am here"); if (XML_Parse(p,Buff,len,done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); exit(-1); } } The contents of the file are kkkk pppp thanks venu ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-03-13 08:56 Message: Logged In: YES user_id=290026 Show us your code - you may have a problem there. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 18:02 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 18:01 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 From noreply at sourceforge.net Sun Apr 3 05:47:18 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Apr 3 05:47:21 2005 Subject: [Expat-bugs] [ expat-Bugs-1175611 ] invalid token parse error Message-ID: Bugs item #1175611, was opened at 2005-04-02 21:59 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1175611&group_id=10127 Category: None Group: None >Status: Closed >Resolution: Duplicate Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: invalid token parse error Initial Comment: hello, i am new to using xml parsers in C. i have been playing with expat on a windows machine running cygwin and a gcc compiler. The version i am using is 1.95.8. i have written a code which i think is ok as its parsing the document ok but to certain extent only.its giving a invalid token error.i am attachig the code and the contents of the xml file if any one would point me to wher i might be making a mistake, i would really appreciate it. the code is attached, the contents of the file are kkkk pppp i am pasting the contents of the file above as the form allows to upload only one file any help would be really appreciated. Thanks venu ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-02 22:47 Message: Logged In: YES user_id=290026 Duplicate of issue # 1157018. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1175611&group_id=10127 From noreply at sourceforge.net Wed Apr 6 19:40:28 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Apr 6 19:40:32 2005 Subject: [Expat-bugs] [ expat-Bugs-1177957 ] Makefile.in doesn't install expat_external.h on SGI Message-ID: Bugs item #1177957, was opened at 2005-04-06 10:40 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=1177957&group_id=10127 Category: Build control Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Greg Stein (gstein) Summary: Makefile.in doesn't install expat_external.h on SGI Initial Comment: (Submitted by Mark Zieg, mark@zieg.com) The conftools/install-sh script provided clearly specifies that it can only install one file at a time. However, there are TWO headers listed in APIHEADER; ergo, the second one gets dropped. The following patch fixes Makefile.in: --- Makefile.in 2004-05-07 16:00:48.000000000 -0400 +++ /home/ziegm/save/Makefile.in 2005-04-06 13:33:57.537788960 -0400 @@ -41,7 +41,8 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h +APIHEADER1 = $(srcdir)/lib/expat.h +APIHEADER2 = $(srcdir)/lib/expat_external.h LIBRARY = libexpat.la @@ -80,7 +81,8 @@ installlib: $(LIBRARY) $(APIHEADER) $(mkinstalldirs) $(libdir) $(includedir) $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) - $(INSTALL_DATA) $(APIHEADER) $(includedir) + $(INSTALL_DATA) $(APIHEADER1) $(includedir) + $(INSTALL_DATA) $(APIHEADER2) $(includedir) uninstall: uninstalllib $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1177957&group_id=10127 From noreply at sourceforge.net Wed Apr 6 19:52:58 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Apr 6 19:53:01 2005 Subject: [Expat-bugs] [ expat-Bugs-1177957 ] Makefile.in doesn't install expat_external.h on SGI Message-ID: Bugs item #1177957, was opened at 2005-04-06 13:40 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1177957&group_id=10127 Category: Build control Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Greg Stein (gstein) Summary: Makefile.in doesn't install expat_external.h on SGI Initial Comment: (Submitted by Mark Zieg, mark@zieg.com) The conftools/install-sh script provided clearly specifies that it can only install one file at a time. However, there are TWO headers listed in APIHEADER; ergo, the second one gets dropped. The following patch fixes Makefile.in: --- Makefile.in 2004-05-07 16:00:48.000000000 -0400 +++ /home/ziegm/save/Makefile.in 2005-04-06 13:33:57.537788960 -0400 @@ -41,7 +41,8 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h +APIHEADER1 = $(srcdir)/lib/expat.h +APIHEADER2 = $(srcdir)/lib/expat_external.h LIBRARY = libexpat.la @@ -80,7 +81,8 @@ installlib: $(LIBRARY) $(APIHEADER) $(mkinstalldirs) $(libdir) $(includedir) $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) - $(INSTALL_DATA) $(APIHEADER) $(includedir) + $(INSTALL_DATA) $(APIHEADER1) $(includedir) + $(INSTALL_DATA) $(APIHEADER2) $(includedir) uninstall: uninstalllib $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-06 13:52 Message: Logged In: YES user_id=290026 I think this has been resolved in CVS. Please check and confirm, so that we can close this issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1177957&group_id=10127 From noreply at sourceforge.net Mon Apr 18 17:04:57 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Apr 18 17:05:00 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 17:04 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=1185243&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Mon Apr 18 19:33:35 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Apr 18 19:33:37 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 11:04 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-18 13:33 Message: Logged In: YES user_id=290026 I cannot reproduce your problem. Are you aware that Expat reports data in UTF-8 or UTF-16 encoding? Which GUI controls do you use to display the data from the character handler? Is it the built-in display of your IDE? It may not handle UTF-8/16. Why don't you write down the hex values from call-back 2) and then look up how character 176 (ISO-8859-1) would be encoded in UTF-8 or UTF-16. Compare this to the call-back data, and you will know if there is a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Tue Apr 19 09:35:06 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 09:35:24 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 17:04 Message generated for change (Comment added) made by janho You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- >Comment By: Jan Hochstein (janho) Date: 2005-04-19 09:35 Message: Logged In: YES user_id=1234078 First of all, the call-back 2) gets two bytes. That would mean a 16-bit wide encoding. But call-backs 1) and 3) get only one byte for each character. The hex codes of the buffers received by the call-backs are these: 1) 4c 61 74 69 74 75 64 65 20 69 73 20 34 32 20 2) c2 b0 3) 20 33 34 27 20 6e 6f 72 74 68 2e I attach the C program used to produce them. If I change the encoding="" in the xml file to UTF-8 the problem persists. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-18 19:33 Message: Logged In: YES user_id=290026 I cannot reproduce your problem. Are you aware that Expat reports data in UTF-8 or UTF-16 encoding? Which GUI controls do you use to display the data from the character handler? Is it the built-in display of your IDE? It may not handle UTF-8/16. Why don't you write down the hex values from call-back 2) and then look up how character 176 (ISO-8859-1) would be encoded in UTF-8 or UTF-16. Compare this to the call-back data, and you will know if there is a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Tue Apr 19 15:49:31 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 15:49:34 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 11:04 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 09:49 Message: Logged In: YES user_id=290026 UTF-8 is a multi-byte encoding. Please determine the exact UTF-8 encoding for the character with Unicode code point 176. It might very well be c2 b0. ---------------------------------------------------------------------- Comment By: Jan Hochstein (janho) Date: 2005-04-19 03:35 Message: Logged In: YES user_id=1234078 First of all, the call-back 2) gets two bytes. That would mean a 16-bit wide encoding. But call-backs 1) and 3) get only one byte for each character. The hex codes of the buffers received by the call-backs are these: 1) 4c 61 74 69 74 75 64 65 20 69 73 20 34 32 20 2) c2 b0 3) 20 33 34 27 20 6e 6f 72 74 68 2e I attach the C program used to produce them. If I change the encoding="" in the xml file to UTF-8 the problem persists. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-18 13:33 Message: Logged In: YES user_id=290026 I cannot reproduce your problem. Are you aware that Expat reports data in UTF-8 or UTF-16 encoding? Which GUI controls do you use to display the data from the character handler? Is it the built-in display of your IDE? It may not handle UTF-8/16. Why don't you write down the hex values from call-back 2) and then look up how character 176 (ISO-8859-1) would be encoded in UTF-8 or UTF-16. Compare this to the call-back data, and you will know if there is a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Tue Apr 19 16:17:56 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 16:17:59 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 17:04 Message generated for change (Comment added) made by janho You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- >Comment By: Jan Hochstein (janho) Date: 2005-04-19 16:17 Message: Logged In: YES user_id=1234078 You are right of course. I was not aware that UTF-8 has characters of different bit lengths. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 15:49 Message: Logged In: YES user_id=290026 UTF-8 is a multi-byte encoding. Please determine the exact UTF-8 encoding for the character with Unicode code point 176. It might very well be c2 b0. ---------------------------------------------------------------------- Comment By: Jan Hochstein (janho) Date: 2005-04-19 09:35 Message: Logged In: YES user_id=1234078 First of all, the call-back 2) gets two bytes. That would mean a 16-bit wide encoding. But call-backs 1) and 3) get only one byte for each character. The hex codes of the buffers received by the call-backs are these: 1) 4c 61 74 69 74 75 64 65 20 69 73 20 34 32 20 2) c2 b0 3) 20 33 34 27 20 6e 6f 72 74 68 2e I attach the C program used to produce them. If I change the encoding="" in the xml file to UTF-8 the problem persists. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-18 19:33 Message: Logged In: YES user_id=290026 I cannot reproduce your problem. Are you aware that Expat reports data in UTF-8 or UTF-16 encoding? Which GUI controls do you use to display the data from the character handler? Is it the built-in display of your IDE? It may not handle UTF-8/16. Why don't you write down the hex values from call-back 2) and then look up how character 176 (ISO-8859-1) would be encoded in UTF-8 or UTF-16. Compare this to the call-back data, and you will know if there is a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Tue Apr 19 19:50:43 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 19:50:46 2005 Subject: [Expat-bugs] [ expat-Bugs-1185243 ] Acirc prepended to entity Message-ID: Bugs item #1185243, was opened at 2005-04-18 11:04 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 Category: None Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Jan Hochstein (janho) Assigned to: Nobody/Anonymous (nobody) Summary: Acirc prepended to entity Initial Comment: Consider the following xml document: ----- ]> Latitude is 42 ° 34' north. ----- The character handler is called three times. The data it receives is this: 1) "Latitude is 42" 2) "??" 3) "34' north." If your encoding is different from mine: the first character received on the second call is HTML Â or ASCII 194. I have found this example to work with any entity not just ° on expat-1.95.7 and expat-1.95.8 . ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 13:50 Message: Logged In: YES user_id=290026 OK, then let's close the issue. ---------------------------------------------------------------------- Comment By: Jan Hochstein (janho) Date: 2005-04-19 10:17 Message: Logged In: YES user_id=1234078 You are right of course. I was not aware that UTF-8 has characters of different bit lengths. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 09:49 Message: Logged In: YES user_id=290026 UTF-8 is a multi-byte encoding. Please determine the exact UTF-8 encoding for the character with Unicode code point 176. It might very well be c2 b0. ---------------------------------------------------------------------- Comment By: Jan Hochstein (janho) Date: 2005-04-19 03:35 Message: Logged In: YES user_id=1234078 First of all, the call-back 2) gets two bytes. That would mean a 16-bit wide encoding. But call-backs 1) and 3) get only one byte for each character. The hex codes of the buffers received by the call-backs are these: 1) 4c 61 74 69 74 75 64 65 20 69 73 20 34 32 20 2) c2 b0 3) 20 33 34 27 20 6e 6f 72 74 68 2e I attach the C program used to produce them. If I change the encoding="" in the xml file to UTF-8 the problem persists. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-18 13:33 Message: Logged In: YES user_id=290026 I cannot reproduce your problem. Are you aware that Expat reports data in UTF-8 or UTF-16 encoding? Which GUI controls do you use to display the data from the character handler? Is it the built-in display of your IDE? It may not handle UTF-8/16. Why don't you write down the hex values from call-back 2) and then look up how character 176 (ISO-8859-1) would be encoded in UTF-8 or UTF-16. Compare this to the call-back data, and you will know if there is a bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1185243&group_id=10127 From noreply at sourceforge.net Tue Apr 19 19:52:00 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 19:52:03 2005 Subject: [Expat-bugs] [ expat-Bugs-1162302 ] Fault CharacterDataHandler if LF starts data Message-ID: Bugs item #1162302, was opened at 2005-03-13 00:26 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1162302&group_id=10127 Category: None Group: Not a Bug >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Fault CharacterDataHandler if LF starts data Initial Comment: When a tag's data start with LF (0x0A), I get XML_CharacterDataHandler with len=1 and s=0x0A instead of the actual data that comes after the LF. On the attached example I get the following calls to XML_CharacterDataHandler : - len =1, s=0x0A - len=6, s="closed" - len =1, s=0x0A - len =1, s=0x0A The last two calls for the function are problematic - I don't get the actual data that comes after the LF. The problem happens when the tag's data start with LF but has more characters after the LF. on Expat-1.95.8 created from expat_win32bin_1_95_8.exe ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 13:52 Message: Logged In: YES user_id=290026 Closing this issue - no follow-up from poster. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-03-14 18:35 Message: Logged In: YES user_id=290026 Just to clarify - in Expat, a contiguous string of characters does not necessarily have to be reported through exactly one characterData() call-back. Often, line-breaks determine the boundary between call-backs. In the attached example, the character data for the element will likely be reported through three call-backs, as there are two line-breaks. ---------------------------------------------------------------------- Comment By: Mike Rosky (mike-rosky) Date: 2005-03-14 08:20 Message: Logged In: YES user_id=1238831 I think that you (original sender) should examine your code, when and for which cases you're calling chardata handler. Please note that basically you have to (simplified) reset chardata buffer at the start element point and accumulate chardata value every time character data handler is invoked until parser calls the end element handler for that element. You can't suppose that chardata handler gets whole value in one call - actually in your case it's called twice because of CRLF, the first call returns CRLF (and eventually preceding chars), the second the rest of chardatas. Chardatas can even cross two source readings, which leads to same effect. You can try it when you add a character data handler to the outline.c example, where chardata handler just prints out the current part enclosed in brackets or something. Mike ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-13 23:36 Message: Logged In: NO The attached example has LF (0x0A) in the following cases: - before the text "sip:pep@example.com" - before the text "Full state presence document" In these 2 cases I receive XML_CharacterDataHandler with len=1 and s=0x0A only. The function is not called for the data AFTER the LF (In the example to "Full state presence document"). Is there a way to overcome this problem? ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-03-13 08:54 Message: Logged In: YES user_id=290026 Your attached example does not have any LF directly before or after the string "closed". Please clarify your problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1162302&group_id=10127 From noreply at sourceforge.net Tue Apr 19 19:52:58 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 19:53:01 2005 Subject: [Expat-bugs] [ expat-Bugs-1157018 ] not well-formed ( invalid token) for Certain XML tags Message-ID: Bugs item #1157018, was opened at 2005-03-04 17:56 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 Category: XML::Parser (inactive) Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: not well-formed ( invalid token) for Certain XML tags Initial Comment: Hello : I have a well formed XML packet but xmlwf thows out error on certain tags adad.dadad test There are lot of other tags before and after these tags ( as shown above ). If i remove this particular section the xmlwf doesn;t show any error. The exact error is :10 : not well-formed (invalid token) 10 is actually the column position. and in the lines shown above , "=" is in the column position 10. Is there any newer version that handles these kind of tags ? or pl. suggest me a work around ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 13:52 Message: Logged In: YES user_id=290026 Closing this issue - no follow-up from poster. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-02 22:46 Message: Logged In: YES user_id=290026 Your main parsing code looks OK, although normally one would use a loop, but in your case it seems the whole file fits into the buffer. However, in your character data handler you are copying to temp_data, which is never allocated. Haven't looked at the other call-backs. You should also be aware that the character data between element tags can be reported through more than one call-back, so you need to buffer them and wait for the end-element call-back before null-terminating them. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-02 21:54 Message: Logged In: NO hello, i am new to using xml parsers in C. i have been playing with expat on a windows machine running cygwin and a gcc compiler. The version i am using is 1.95.8. i have written a code which i think is ok as its parsing the document ok to certain extent only.its giving a invalid token error.i am attachig the code and the contents of the xml file if any one would point me to wher i might be making a mistake i would really appreciate it. the code is below /***************************************************************** * This program reads from an xml file and builds a tree that is later used to populate the array structure of nics, cabs etc */ #include #include #include "expat.h" #define BUFFSIZE 18192 char Buff[BUFFSIZE]; int Depth; struct node{ char *node_name; //name of the node char **attr_name; //string list of attribute name char **attr_val; //array of values of the attributes char *text; //text that is associated with this node struct node **child; //array of children that this node can have struct node *parent; //pointer to the parent of the current node int child_no; }; /* This handler is called when ever a start tag is encountered in the input stream */ static void XMLCALL start(void *userData, const char *el, const char **attr) { struct node **temp_ptr = (struct node**)userData; printf("i am in start\n"); add_node(temp_ptr, el); } /* This handler is called when ever an end tag is encountered in the input stream */ static void XMLCALL end(void *userData, const char *el) { printf("i am in end\n"); struct node **temp_ptr = (struct node**)userData; close_node(temp_ptr); } /* This handler is called when ever a character tag is encountered in the input stream */ static void XMLCALL char_handle(void *userData, const XML_Char *s, int len){ char *data = (char *)s ; // pointer to the new string that we construct char *temp_data; int i = len; struct node **temp_ptr = (struct node**)userData; if (len >1) { while(i>0){ *temp_data = *data; i--; data++; temp_data++; } *temp_data = '\0'; temp_data = temp_data - len; printf("i am in char handle %s and len=%d\n", temp_data,len); } add_text(temp_ptr,data); } void add_node(struct node **void_node_ptr, char *el ){ struct node* next_node_ptr = (struct node*)malloc(sizeof (struct node*)); next_node_ptr->child_no = 0; struct node *current_node_ptr = (struct node *) *void_node_ptr; // update the previous node with the address of the current node // current_node_ptr->child[current_node_ptr- >child_no] = next_node_ptr; //current_node_ptr->child_no++; next_node_ptr->node_name = el; next_node_ptr->parent = current_node_ptr; current_node_ptr = next_node_ptr; } void add_text(struct node **void_node_ptr,char *data ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr->text = data; //printf(" in add_text with %s", current_node_ptr- >text); } void close_node(struct node **void_node_ptr ){ struct node *current_node_ptr = (struct node *) *void_node_ptr; current_node_ptr = current_node_ptr->parent; } void main(int argc, char *argv[]){ printf("i am in main\n"); XML_Parser p = XML_ParserCreate(NULL); if (! p) { fprintf(stderr, "Couldn't allocate memory for parser\n"); exit(-1); } //char *testdata = "venu\0"; struct node *node_ptr = (struct node*)malloc(sizeof(struct node*)); node_ptr->child_no = 0; //struct node *current_node_ptr = node_ptr; void *userData = (void *)node_ptr; XML_SetElementHandler(p, start, end); XML_SetCharacterDataHandler(p,char_handle); XML_SetUserData(p, &userData); FILE *fp; int len; int done=1; fp = fopen("/cygdrive/c/master-project/C- programming/test2.xml", "r"); len = fread(Buff, 1, BUFFSIZE, fp); printf("bytes read are %d and buffer has %d\n", len,sizeof (Buff)); fclose(fp); //printf("i am here"); if (XML_Parse(p,Buff,len,done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); exit(-1); } } The contents of the file are kkkk pppp thanks venu ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-03-13 08:56 Message: Logged In: YES user_id=290026 Show us your code - you may have a problem there. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 18:02 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-04 18:01 Message: Logged In: NO Operating System is HP-UX. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1157018&group_id=10127 From noreply at sourceforge.net Tue Apr 19 19:56:26 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 19:56:29 2005 Subject: [Expat-bugs] [ expat-Bugs-1023646 ] Error in codepageMap, codepage.c Message-ID: Bugs item #1023646, was opened at 2004-09-07 08:39 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127 Category: None Group: Platform Specific Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Karl Waclawek (kwaclaw) Summary: Error in codepageMap, codepage.c Initial Comment: Applies to expat v.1.95.8 >From MS: "LeadByte: Specifies a fixed-length array of lead-byte ranges, where the number of lead-byte ranges is variable. If there are no lead bytes in this code page, then every element of the array is NULL. If there are lead bytes in this code page, a starting value and ending value is specified for each range. Ranges are inclusive. The maximum number of lead-byte ranges for any code page is five. The array uses two bytes to describe each range, with a double-byte null terminator after the last range." Note that "Ranges are inclusive". Therefore the function codepageMap should be changed: for (i = 0; i < MAX_LEADBYTES; i+=2) { int j, lim; if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) break; lim = info.LeadByte[i + 1]; for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2; } Regards, Ole Stauning, spam@uning.dk ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 13:56 Message: Logged In: YES user_id=290026 To Fred: Has this been committed yet? ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2005-01-27 10:17 Message: Logged In: YES user_id=3066 Then I think this is ok to commit if everything continues to work for you on Windows. I'll email the original poster since it doesn't look like SF will be sending him updates automatically. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-01-27 09:46 Message: Logged In: YES user_id=290026 FWIW, I agree with the above conclusions as well. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2005-01-27 00:44 Message: Logged In: YES user_id=3066 I'm inclined to agree, having read the CPINFO documentation. Do you have a test case that breaks using the current code, and which your proposed change would fix? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127 From noreply at sourceforge.net Tue Apr 19 20:26:30 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Apr 19 20:26:33 2005 Subject: [Expat-bugs] [ expat-Bugs-1023646 ] Error in codepageMap, codepage.c Message-ID: Bugs item #1023646, was opened at 2004-09-07 08:39 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127 Category: None Group: Platform Specific Status: Open >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Error in codepageMap, codepage.c Initial Comment: Applies to expat v.1.95.8 >From MS: "LeadByte: Specifies a fixed-length array of lead-byte ranges, where the number of lead-byte ranges is variable. If there are no lead bytes in this code page, then every element of the array is NULL. If there are lead bytes in this code page, a starting value and ending value is specified for each range. Ranges are inclusive. The maximum number of lead-byte ranges for any code page is five. The array uses two bytes to describe each range, with a double-byte null terminator after the last range." Note that "Ranges are inclusive". Therefore the function codepageMap should be changed: for (i = 0; i < MAX_LEADBYTES; i+=2) { int j, lim; if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) break; lim = info.LeadByte[i + 1]; for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2; } Regards, Ole Stauning, spam@uning.dk ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 14:26 Message: Logged In: YES user_id=290026 Forget my question, I went ahead and committed it. See codepage.c rev. 1.12. Assigned to Fred for testing. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-19 13:56 Message: Logged In: YES user_id=290026 To Fred: Has this been committed yet? ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2005-01-27 10:17 Message: Logged In: YES user_id=3066 Then I think this is ok to commit if everything continues to work for you on Windows. I'll email the original poster since it doesn't look like SF will be sending him updates automatically. ---------------------------------------------------------------------- Comment By: Karl Waclawek (kwaclaw) Date: 2005-01-27 09:46 Message: Logged In: YES user_id=290026 FWIW, I agree with the above conclusions as well. ---------------------------------------------------------------------- Comment By: Fred L. Drake, Jr. (fdrake) Date: 2005-01-27 00:44 Message: Logged In: YES user_id=3066 I'm inclined to agree, having read the CPINFO documentation. Do you have a test case that breaks using the current code, and which your proposed change would fix? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127 From noreply at sourceforge.net Wed Apr 27 02:25:27 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Apr 27 02:25:30 2005 Subject: [Expat-bugs] [ expat-Bugs-1190650 ] Incorrectly parses property whose value is the property name Message-ID: Bugs item #1190650, was opened at 2005-04-26 17:25 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=1190650&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrectly parses property whose value is the property name Initial Comment: I'm using Expat 1.95.8. When I parse an XML doc which has a property whose value is the same as that property's name, and there is another XML property after it in the same XML element, then Expat misinterprets the first property's value to be the second property's name. An example that demonstrates this (more tersely, too!) is that Expat parses the input: ...as if it were: Another example would be: ...becomes: It's a pretty rare case, obviously. Thanks, Daniel Brewer dbrewer( at-no spam )extensis.com ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190650&group_id=10127 From noreply at sourceforge.net Wed Apr 27 04:40:06 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Apr 27 04:40:18 2005 Subject: [Expat-bugs] [ expat-Bugs-1190650 ] Incorrectly parses property whose value is the property name Message-ID: Bugs item #1190650, was opened at 2005-04-26 20:25 Message generated for change (Comment added) made by kwaclaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190650&group_id=10127 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Karl Waclawek (kwaclaw) Summary: Incorrectly parses property whose value is the property name Initial Comment: I'm using Expat 1.95.8. When I parse an XML doc which has a property whose value is the same as that property's name, and there is another XML property after it in the same XML element, then Expat misinterprets the first property's value to be the second property's name. An example that demonstrates this (more tersely, too!) is that Expat parses the input: ...as if it were: Another example would be: ...becomes: It's a pretty rare case, obviously. Thanks, Daniel Brewer dbrewer( at-no spam )extensis.com ---------------------------------------------------------------------- >Comment By: Karl Waclawek (kwaclaw) Date: 2005-04-26 22:40 Message: Logged In: YES user_id=290026 This works fine for me with current CVS. Are you sure the problem is not in your code? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190650&group_id=10127 From li.xu at ge.com Wed Apr 27 04:30:12 2005 From: li.xu at ge.com (Xu, Li (Research)) Date: Wed Apr 27 08:31:30 2005 Subject: [Expat-bugs] expat compile error Message-ID: Hello all, I encountered an compile error when build expat-1.95.8 under cygwin2.29 error message: /usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined = reference to `WinMain@16' Does anyone met the same error before? Should i need a more recent = Cygwin version to build the expat? Thanks and Regards Li > g GE Global Research Center _________________________________________________ Xu Li Real-time / Power Controls Lab (EPST) GE Global Research Center - Shanghai 1800 Cailun Rd. Zhangjiang High-tech Park, Shanghai, 201203, China D: 388-1291 T: (86-21)50504666-1291 F: (86-21)50807277 E: li.xu@ge.com From noreply at sourceforge.net Wed Apr 27 11:57:33 2005 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Apr 27 11:57:35 2005 Subject: [Expat-bugs] [ expat-Bugs-1190887 ] bad charset mangement in DTD Message-ID: Bugs item #1190887, was opened at 2005-04-27 02:57 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=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@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; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1190887&group_id=10127