From kwaclaw at users.sourceforge.net Tue Jan 14 16:51:17 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Tue Jan 14 19:51:21 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.100,1.101
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv7708
Modified Files:
xmlparse.c
Log Message:
Applied patch for bug #667511 supplied by Jeremy Kloth.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- xmlparse.c 30 Dec 2002 20:10:32 -0000 1.100
+++ xmlparse.c 15 Jan 2003 00:51:15 -0000 1.101
@@ -1730,7 +1730,7 @@
if (tag->name.str == (XML_Char *)tag->buf)
tag->name.str = (XML_Char *)temp;
/* if tag->name.localPart is set (when namespace processing is on)
- then update it as well, since it will always point into tag-buf
+ then update it as well, since it will always point into tag->buf
*/
if (tag->name.localPart)
tag->name.localPart = (XML_Char *)temp + (tag->name.localPart -
@@ -2344,10 +2344,10 @@
if (tagNamePtr) {
elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
if (!elementType) {
- tagNamePtr->str = poolCopyString(&dtd->pool, tagNamePtr->str);
- if (!tagNamePtr->str)
+ const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
+ if (!name)
return XML_ERROR_NO_MEMORY;
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,
+ elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
sizeof(ELEMENT_TYPE));
if (!elementType)
return XML_ERROR_NO_MEMORY;
From kwaclaw at users.sourceforge.net Thu Jan 16 14:03:45 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Thu Jan 16 17:03:49 2003
Subject: [Expat-checkins] expat/lib expat.h,1.49,1.50 libexpat.def,1.3,1.4
libexpatw.def,1.3,1.4 xmlparse.c,1.101,1.102
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv20065
Modified Files:
expat.h libexpat.def libexpatw.def xmlparse.c
Log Message:
Patch for bug/feature request #651754.
Implemented with two API additions:
1) For element declaration handler support:
XML_FreeContentModel
2) Exposing Expat's memory allocation functions:
XML_MemMalloc
XML_MemRealloc
XML_MemFree
Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- expat.h 31 Dec 2002 17:53:21 -0000 1.49
+++ expat.h 16 Jan 2003 22:03:42 -0000 1.50
@@ -208,7 +208,7 @@
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
-/* Constructs a new parser using the memory management suit referred to
+/* Constructs a new parser using the memory management suite referred to
by memsuite. If memsuite is NULL, then use the standard library memory
suite. If namespaceSeparator is non-NULL it creates a parser with
namespace processing as described above. The character pointed at
@@ -848,6 +848,20 @@
#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
+
+/* Frees the content model passed to the element declaration handler */
+XMLPARSEAPI(void)
+XML_FreeContentModel(XML_Parser parser, XML_Content *model);
+
+/* Exposing the memory handling functions used in Expat */
+XMLPARSEAPI(void *)
+XML_MemMalloc(XML_Parser parser, size_t size);
+
+XMLPARSEAPI(void *)
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
+
+XMLPARSEAPI(void)
+XML_MemFree(XML_Parser parser, void *ptr);
/* Frees memory used by the parser. */
XMLPARSEAPI(void)
Index: libexpat.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpat.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libexpat.def 8 Dec 2002 14:35:33 -0000 1.3
+++ libexpat.def 16 Jan 2003 22:03:42 -0000 1.4
@@ -56,8 +56,14 @@
XML_SetUserData @52
XML_SetXmlDeclHandler @53
XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
XML_ParserReset @55
XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
XML_GetFeatureList @57
XML_UseForeignDTD @58
+; added with version 1.95.6
+ XML_FreeContentModel @59
+ XML_MemMalloc @60
+ XML_MemRealloc @61
+ XML_MemFree @62
Index: libexpatw.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpatw.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libexpatw.def 8 Dec 2002 14:35:34 -0000 1.3
+++ libexpatw.def 16 Jan 2003 22:03:42 -0000 1.4
@@ -56,8 +56,14 @@
XML_SetUserData @52
XML_SetXmlDeclHandler @53
XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
XML_ParserReset @55
XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
XML_GetFeatureList @57
XML_UseForeignDTD @58
+; added with version 1.95.6
+ XML_FreeContentModel @59
+ XML_MemMalloc @60
+ XML_MemRealloc @61
+ XML_MemFree @62
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- xmlparse.c 15 Jan 2003 00:51:15 -0000 1.101
+++ xmlparse.c 16 Jan 2003 22:03:42 -0000 1.102
@@ -1584,6 +1584,30 @@
}
void
+XML_FreeContentModel(XML_Parser parser, XML_Content *model)
+{
+ FREE(model);
+}
+
+void *
+XML_MemMalloc(XML_Parser parser, size_t size)
+{
+ return MALLOC(size);
+}
+
+void *
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
+{
+ return REALLOC(ptr, size);
+}
+
+void
+XML_MemFree(XML_Parser parser, void *ptr)
+{
+ FREE(ptr);
+}
+
+void
XML_DefaultCurrent(XML_Parser parser)
{
if (defaultHandler) {
From kwaclaw at users.sourceforge.net Thu Jan 16 14:05:48 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Thu Jan 16 17:05:51 2003
Subject: [Expat-checkins]
expat/bcb5 libexpat_mtd.def,1.1,1.2 libexpatw_mtd.def,1.1,1.2
Message-ID:
Update of /cvsroot/expat/expat/bcb5
In directory sc8-pr-cvs1:/tmp/cvs-serv20439
Modified Files:
libexpat_mtd.def libexpatw_mtd.def
Log Message:
Updating Borland BCB5 DEF files for patch re. bug/feature request #651754
Index: libexpat_mtd.def
===================================================================
RCS file: /cvsroot/expat/expat/bcb5/libexpat_mtd.def,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- libexpat_mtd.def 8 Dec 2002 03:37:41 -0000 1.1
+++ libexpat_mtd.def 16 Jan 2003 22:05:46 -0000 1.2
@@ -56,69 +56,78 @@
_XML_SetUserData @52
_XML_SetXmlDeclHandler @53
_XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
_XML_ParserReset @55
_XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
_XML_GetFeatureList @57
_XML_UseForeignDTD @58
+; added with version 1.95.6
+ _XML_FreeContentModel @59
+ _XML_MemMalloc @60
+ _XML_MemRealloc @61
+ _XML_MemFree @62
; Aliases for MS compatible names
- XML_DefaultCurrent = _XML_DefaultCurrent
- XML_ErrorString = _XML_ErrorString
- XML_ExpatVersion = _XML_ExpatVersion
- XML_ExpatVersionInfo = _XML_ExpatVersionInfo
- XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate
- XML_GetBase = _XML_GetBase
- XML_GetBuffer = _XML_GetBuffer
- XML_GetCurrentByteCount = _XML_GetCurrentByteCount
- XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex
- XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber
- XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber
- XML_GetErrorCode = _XML_GetErrorCode
- XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex
- XML_GetInputContext = _XML_GetInputContext
- XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount
- XML_Parse = _XML_Parse
- XML_ParseBuffer = _XML_ParseBuffer
- XML_ParserCreate = _XML_ParserCreate
- XML_ParserCreateNS = _XML_ParserCreateNS
- XML_ParserCreate_MM = _XML_ParserCreate_MM
- XML_ParserFree = _XML_ParserFree
- XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler
- XML_SetBase = _XML_SetBase
- XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler
- XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler
- XML_SetCommentHandler = _XML_SetCommentHandler
- XML_SetDefaultHandler = _XML_SetDefaultHandler
- XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand
- XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler
- XML_SetElementDeclHandler = _XML_SetElementDeclHandler
- XML_SetElementHandler = _XML_SetElementHandler
- XML_SetEncoding = _XML_SetEncoding
- XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler
- XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler
- XML_SetEndElementHandler = _XML_SetEndElementHandler
- XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler
- XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler
- XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler
- XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg
- XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler
- XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler
- XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler
- XML_SetParamEntityParsing = _XML_SetParamEntityParsing
- XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler
- XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet
- XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler
- XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler
- XML_SetStartElementHandler = _XML_SetStartElementHandler
- XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler
- XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler
- XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler
- XML_SetUserData = _XML_SetUserData
- XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler
- XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg
- XML_ParserReset = _XML_ParserReset
- XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler
- XML_GetFeatureList = _XML_GetFeatureList
- XML_UseForeignDTD = _XML_UseForeignDTD
-
+ XML_DefaultCurrent = _XML_DefaultCurrent
+ XML_ErrorString = _XML_ErrorString
+ XML_ExpatVersion = _XML_ExpatVersion
+ XML_ExpatVersionInfo = _XML_ExpatVersionInfo
+ XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate
+ XML_GetBase = _XML_GetBase
+ XML_GetBuffer = _XML_GetBuffer
+ XML_GetCurrentByteCount = _XML_GetCurrentByteCount
+ XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex
+ XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber
+ XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber
+ XML_GetErrorCode = _XML_GetErrorCode
+ XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex
+ XML_GetInputContext = _XML_GetInputContext
+ XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount
+ XML_Parse = _XML_Parse
+ XML_ParseBuffer = _XML_ParseBuffer
+ XML_ParserCreate = _XML_ParserCreate
+ XML_ParserCreateNS = _XML_ParserCreateNS
+ XML_ParserCreate_MM = _XML_ParserCreate_MM
+ XML_ParserFree = _XML_ParserFree
+ XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler
+ XML_SetBase = _XML_SetBase
+ XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler
+ XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler
+ XML_SetCommentHandler = _XML_SetCommentHandler
+ XML_SetDefaultHandler = _XML_SetDefaultHandler
+ XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand
+ XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler
+ XML_SetElementDeclHandler = _XML_SetElementDeclHandler
+ XML_SetElementHandler = _XML_SetElementHandler
+ XML_SetEncoding = _XML_SetEncoding
+ XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler
+ XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler
+ XML_SetEndElementHandler = _XML_SetEndElementHandler
+ XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler
+ XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler
+ XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler
+ XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg
+ XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler
+ XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler
+ XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler
+ XML_SetParamEntityParsing = _XML_SetParamEntityParsing
+ XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler
+ XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet
+ XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler
+ XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler
+ XML_SetStartElementHandler = _XML_SetStartElementHandler
+ XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler
+ XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler
+ XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler
+ XML_SetUserData = _XML_SetUserData
+ XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler
+ XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg
+ XML_ParserReset = _XML_ParserReset
+ XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler
+ XML_GetFeatureList = _XML_GetFeatureList
+ XML_UseForeignDTD = _XML_UseForeignDTD
+ XML_FreeContentModel = _XML_FreeContentModel
+ XML_MemMalloc = _XML_MemMalloc
+ XML_MemRealloc = _XML_MemRealloc
+ XML_MemFree = _XML_MemFree
Index: libexpatw_mtd.def
===================================================================
RCS file: /cvsroot/expat/expat/bcb5/libexpatw_mtd.def,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- libexpatw_mtd.def 8 Dec 2002 03:37:41 -0000 1.1
+++ libexpatw_mtd.def 16 Jan 2003 22:05:46 -0000 1.2
@@ -56,69 +56,78 @@
_XML_SetUserData @52
_XML_SetXmlDeclHandler @53
_XML_UseParserAsHandlerArg @54
-; added with version 1.95.4
+; added with version 1.95.3
_XML_ParserReset @55
_XML_SetSkippedEntityHandler @56
+; added with version 1.95.4
_XML_GetFeatureList @57
_XML_UseForeignDTD @58
+; added with version 1.95.6
+ _XML_FreeContentModel @59
+ _XML_MemMalloc @60
+ _XML_MemRealloc @61
+ _XML_MemFree @62
; Aliases for MS compatible names
- XML_DefaultCurrent = _XML_DefaultCurrent
- XML_ErrorString = _XML_ErrorString
- XML_ExpatVersion = _XML_ExpatVersion
- XML_ExpatVersionInfo = _XML_ExpatVersionInfo
- XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate
- XML_GetBase = _XML_GetBase
- XML_GetBuffer = _XML_GetBuffer
- XML_GetCurrentByteCount = _XML_GetCurrentByteCount
- XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex
- XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber
- XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber
- XML_GetErrorCode = _XML_GetErrorCode
- XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex
- XML_GetInputContext = _XML_GetInputContext
- XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount
- XML_Parse = _XML_Parse
- XML_ParseBuffer = _XML_ParseBuffer
- XML_ParserCreate = _XML_ParserCreate
- XML_ParserCreateNS = _XML_ParserCreateNS
- XML_ParserCreate_MM = _XML_ParserCreate_MM
- XML_ParserFree = _XML_ParserFree
- XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler
- XML_SetBase = _XML_SetBase
- XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler
- XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler
- XML_SetCommentHandler = _XML_SetCommentHandler
- XML_SetDefaultHandler = _XML_SetDefaultHandler
- XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand
- XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler
- XML_SetElementDeclHandler = _XML_SetElementDeclHandler
- XML_SetElementHandler = _XML_SetElementHandler
- XML_SetEncoding = _XML_SetEncoding
- XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler
- XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler
- XML_SetEndElementHandler = _XML_SetEndElementHandler
- XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler
- XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler
- XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler
- XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg
- XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler
- XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler
- XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler
- XML_SetParamEntityParsing = _XML_SetParamEntityParsing
- XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler
- XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet
- XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler
- XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler
- XML_SetStartElementHandler = _XML_SetStartElementHandler
- XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler
- XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler
- XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler
- XML_SetUserData = _XML_SetUserData
- XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler
- XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg
- XML_ParserReset = _XML_ParserReset
- XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler
- XML_GetFeatureList = _XML_GetFeatureList
- XML_UseForeignDTD = _XML_UseForeignDTD
-
+ XML_DefaultCurrent = _XML_DefaultCurrent
+ XML_ErrorString = _XML_ErrorString
+ XML_ExpatVersion = _XML_ExpatVersion
+ XML_ExpatVersionInfo = _XML_ExpatVersionInfo
+ XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate
+ XML_GetBase = _XML_GetBase
+ XML_GetBuffer = _XML_GetBuffer
+ XML_GetCurrentByteCount = _XML_GetCurrentByteCount
+ XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex
+ XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber
+ XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber
+ XML_GetErrorCode = _XML_GetErrorCode
+ XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex
+ XML_GetInputContext = _XML_GetInputContext
+ XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount
+ XML_Parse = _XML_Parse
+ XML_ParseBuffer = _XML_ParseBuffer
+ XML_ParserCreate = _XML_ParserCreate
+ XML_ParserCreateNS = _XML_ParserCreateNS
+ XML_ParserCreate_MM = _XML_ParserCreate_MM
+ XML_ParserFree = _XML_ParserFree
+ XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler
+ XML_SetBase = _XML_SetBase
+ XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler
+ XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler
+ XML_SetCommentHandler = _XML_SetCommentHandler
+ XML_SetDefaultHandler = _XML_SetDefaultHandler
+ XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand
+ XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler
+ XML_SetElementDeclHandler = _XML_SetElementDeclHandler
+ XML_SetElementHandler = _XML_SetElementHandler
+ XML_SetEncoding = _XML_SetEncoding
+ XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler
+ XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler
+ XML_SetEndElementHandler = _XML_SetEndElementHandler
+ XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler
+ XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler
+ XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler
+ XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg
+ XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler
+ XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler
+ XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler
+ XML_SetParamEntityParsing = _XML_SetParamEntityParsing
+ XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler
+ XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet
+ XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler
+ XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler
+ XML_SetStartElementHandler = _XML_SetStartElementHandler
+ XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler
+ XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler
+ XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler
+ XML_SetUserData = _XML_SetUserData
+ XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler
+ XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg
+ XML_ParserReset = _XML_ParserReset
+ XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler
+ XML_GetFeatureList = _XML_GetFeatureList
+ XML_UseForeignDTD = _XML_UseForeignDTD
+ XML_FreeContentModel = _XML_FreeContentModel
+ XML_MemMalloc = _XML_MemMalloc
+ XML_MemRealloc = _XML_MemRealloc
+ XML_MemFree = _XML_MemFree
From kwaclaw at users.sourceforge.net Thu Jan 16 14:07:28 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Thu Jan 16 17:07:31 2003
Subject: [Expat-checkins] expat/bcb5 makefile.mak,1.5,1.6
Message-ID:
Update of /cvsroot/expat/expat/bcb5
In directory sc8-pr-cvs1:/tmp/cvs-serv20643
Modified Files:
makefile.mak
Log Message:
Change to support Windows 2000 behaviour by default
Index: makefile.mak
===================================================================
RCS file: /cvsroot/expat/expat/bcb5/makefile.mak,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- makefile.mak 7 Dec 2002 08:59:43 -0000 1.5
+++ makefile.mak 16 Jan 2003 22:07:26 -0000 1.6
@@ -26,12 +26,12 @@
clean:
# works on Win98/ME
- deltree /y release\obj
+# deltree /y release\obj
# works on WinNT/2000
-# del /s/f/q release\obj
+ del /s/f/q release\obj
distclean:
# works on Win98/ME
- deltree /y release\*.*
+# deltree /y release\*.*
# works on WinNT/2000
-# del /s/f/q release\*
+ del /s/f/q release\*
From fdrake at acm.org Thu Jan 16 17:09:18 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Thu Jan 16 17:10:16 2003
Subject: [Expat-checkins] expat/lib expat.h,1.49,1.50 libexpat.def,1.3,1.4
libexpatw.def,1.3,1.4 xmlparse.c,1.101,1.102
In-Reply-To:
References:
Message-ID: <15911.11662.602884.292320@grendel.zope.com>
Karl Waclawek writes:
> Implemented with two API additions:
> 1) For element declaration handler support:
> XML_FreeContentModel
> 2) Exposing Expat's memory allocation functions:
> XML_MemMalloc
> XML_MemRealloc
> XML_MemFree
Yee haw! ;-) I *should* be able to write docs tonight.
> Index: libexpat.def
> ===================================================================
...
> +; added with version 1.95.4
> XML_GetFeatureList @57
> XML_UseForeignDTD @58
Sheesh, I thought those were added in 1.95.5. Must be getting old. ;-(
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From fdrake at users.sourceforge.net Thu Jan 16 15:15:21 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Thu Jan 16 18:15:25 2003
Subject: [Expat-checkins] expat/doc reference.html,1.38,1.39
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv28683
Modified Files:
reference.html
Log Message:
Add documentation for XML_FreeContentModel(), XML_MemMalloc(),
XML_MemRealloc(), and XML_MemFree().
Index: reference.html
===================================================================
RCS file: /cvsroot/expat/expat/doc/reference.html,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- reference.html 30 Dec 2002 20:12:52 -0000 1.38
+++ reference.html 16 Jan 2003 23:15:19 -0000 1.39
@@ -119,6 +119,10 @@
XML_ExpatVersion
XML_ExpatVersionInfo
XML_GetFeatureList
+ XML_FreeContentModel
+ XML_MemMalloc
+ XML_MemRealloc
+ XML_MemFree
@@ -1256,7 +1260,9 @@
Sets a handler for element declarations in a DTD. The handler gets
called with the name of the element in the declaration and a pointer
to a structure that contains the element model. It is the
-application's responsibility to free this data structure.
+application's responsibility to free this data structure using
+XML_FreeContentModel
.
The model
argument is the root of a tree of
XML_Content
nodes. If type
equals
@@ -1776,6 +1782,66 @@
reported by XML_GetInputContext
.
+
+
+
+void
+XML_FreeContentModel(XML_Parser parser, XML_Content *model);
+
+
+Function to deallocate the
model
argument passed to the
+
XML_ElementDeclHandler
callback set using
XML_ElementDeclHandler
.
+This function should not be used for any other purpose.
+
+
+The following functions allow external code to share the memory
+allocator an XML_Parser
has been configured to use. This
+is especially useful for third-party libraries that interact with a
+parser object created by application code, or heavily layered
+applications. This can be essential when using dynamically loaded
+libraries which use different C standard libraries (this can happen on
+Windows, at least).
+
+
+void *
+XML_MemMalloc(XML_Parser parser, size_t size);
+
+
+Allocate
size
bytes of memory using the allocator the
+
parser
object has been configured to use. Returns a
+pointer to the memory or NULL on failure. Memory allocated in this
+way must be freed using
XML_MemFree
.
+
+
+
+void *
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
+
+
+Allocate
size
bytes of memory using the allocator the
+
parser
object has been configured to use.
+
ptr
must point to a block of memory allocated by
XML_MemMalloc
or
+
XML_MemRealloc
, or be NULL. This function tries to
+expand the block pointed to by
ptr
if possible. Returns
+a pointer to the memory or NULL on failure. On success, the original
+block has either been expanded or freed. On failure, the original
+block has not been freed; the caller is responsible for freeing the
+original block. Memory allocated in this way must be freed using
+
XML_MemFree
.
+
+
+
+void
+XML_MemFree(XML_Parser parser, void *ptr);
+
+
+Free a block of memory pointed to by
ptr
. The block must
+have been allocated by
XML_MemMalloc
or
XML_MemRealloc
, or be NULL.
From fdrake at users.sourceforge.net Thu Jan 16 15:22:58 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Thu Jan 16 18:23:01 2003
Subject: [Expat-checkins] expat/lib libexpat.def,1.4,1.5 libexpatw.def,1.4,1.5
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv29755/lib
Modified Files:
libexpat.def libexpatw.def
Log Message:
Correct the version some APIs were added in.
Index: libexpat.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpat.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- libexpat.def 16 Jan 2003 22:03:42 -0000 1.4
+++ libexpat.def 16 Jan 2003 23:22:56 -0000 1.5
@@ -59,7 +59,7 @@
; added with version 1.95.3
XML_ParserReset @55
XML_SetSkippedEntityHandler @56
-; added with version 1.95.4
+; added with version 1.95.5
XML_GetFeatureList @57
XML_UseForeignDTD @58
; added with version 1.95.6
Index: libexpatw.def
===================================================================
RCS file: /cvsroot/expat/expat/lib/libexpatw.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- libexpatw.def 16 Jan 2003 22:03:42 -0000 1.4
+++ libexpatw.def 16 Jan 2003 23:22:56 -0000 1.5
@@ -59,7 +59,7 @@
; added with version 1.95.3
XML_ParserReset @55
XML_SetSkippedEntityHandler @56
-; added with version 1.95.4
+; added with version 1.95.5
XML_GetFeatureList @57
XML_UseForeignDTD @58
; added with version 1.95.6
From fdrake at users.sourceforge.net Thu Jan 16 15:24:40 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Thu Jan 16 18:24:43 2003
Subject: [Expat-checkins] expat Changes,1.30,1.31
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv29958
Modified Files:
Changes
Log Message:
Added notes about the new APIs.
Index: Changes
===================================================================
RCS file: /cvsroot/expat/expat/Changes,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Changes 7 Oct 2002 20:25:24 -0000 1.30
+++ Changes 16 Jan 2003 23:24:38 -0000 1.31
@@ -1,5 +1,8 @@
Release 1.95.6
+ - Added XML_FreeContentModel().
+ - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
- Fixed a variety of bugs: see SF issues 615606, 616863, 618199.
+ - Enhanced the regression test suite.
Release 1.95.5 Fri Sep 6 2002
- Added XML_UseForeignDTD() for improved SAX2 support.
From kwaclaw at users.sourceforge.net Thu Jan 16 16:49:14 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Thu Jan 16 19:49:17 2003
Subject: [Expat-checkins]
expat/bcb5 libexpat_mtd.def,1.2,1.3 libexpatw_mtd.def,1.2,1.3
Message-ID:
Update of /cvsroot/expat/expat/bcb5
In directory sc8-pr-cvs1:/tmp/cvs-serv6102
Modified Files:
libexpat_mtd.def libexpatw_mtd.def
Log Message:
Correct the version some APIs were added in.
Index: libexpat_mtd.def
===================================================================
RCS file: /cvsroot/expat/expat/bcb5/libexpat_mtd.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- libexpat_mtd.def 16 Jan 2003 22:05:46 -0000 1.2
+++ libexpat_mtd.def 17 Jan 2003 00:49:12 -0000 1.3
@@ -59,7 +59,7 @@
; added with version 1.95.3
_XML_ParserReset @55
_XML_SetSkippedEntityHandler @56
-; added with version 1.95.4
+; added with version 1.95.5
_XML_GetFeatureList @57
_XML_UseForeignDTD @58
; added with version 1.95.6
Index: libexpatw_mtd.def
===================================================================
RCS file: /cvsroot/expat/expat/bcb5/libexpatw_mtd.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- libexpatw_mtd.def 16 Jan 2003 22:05:46 -0000 1.2
+++ libexpatw_mtd.def 17 Jan 2003 00:49:12 -0000 1.3
@@ -59,7 +59,7 @@
; added with version 1.95.3
_XML_ParserReset @55
_XML_SetSkippedEntityHandler @56
-; added with version 1.95.4
+; added with version 1.95.5
_XML_GetFeatureList @57
_XML_UseForeignDTD @58
; added with version 1.95.6
From fdrake at users.sourceforge.net Mon Jan 20 06:49:47 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Mon Jan 20 09:49:50 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.41,1.42
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv8783/tests
Modified Files:
runtests.c
Log Message:
Minor cleanups and conformance with current recommended usage.
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- runtests.c 30 Dec 2002 19:33:21 -0000 1.41
+++ runtests.c 20 Jan 2003 14:49:44 -0000 1.42
@@ -705,12 +705,12 @@
int i;
for (i = 0; i < 256; ++i)
info->map[i] = i;
- info->data=NULL;
- info->convert=NULL;
- info->release=NULL;
- return 1;
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = NULL;
+ return XML_STATUS_OK;
}
- return 0;
+ return XML_STATUS_ERROR;
}
START_TEST(test_unknown_encoding_internal_entity)
@@ -821,9 +821,9 @@
fail("Could not create external entity parser.");
if (XML_Parse(extparser, text, strlen(text), 1) == XML_STATUS_ERROR) {
xml_failure(parser);
- return 0;
+ return XML_STATUS_ERROR;
}
- return 1;
+ return XML_STATUS_OK;
}
/* Test that an error is reported for unknown entities if we have read
@@ -842,7 +842,7 @@
XML_SetExternalEntityRefHandler(parser, external_entity_loader);
expect_failure(text,
XML_ERROR_UNDEFINED_ENTITY,
- "Parser did not report undefined entity with DTD.");
+ "Parser did not report undefined entity (external DTD).");
}
END_TEST
From fdrake at users.sourceforge.net Mon Jan 20 07:01:01 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Mon Jan 20 10:01:04 2003
Subject: [Expat-checkins] expat MANIFEST,1.18,1.19
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv20228
Modified Files:
MANIFEST
Log Message:
Update the list of project files for the Borland tools.
Index: MANIFEST
===================================================================
RCS file: /cvsroot/expat/expat/MANIFEST,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- MANIFEST 5 Sep 2002 21:29:12 -0000 1.18
+++ MANIFEST 20 Jan 2003 15:00:57 -0000 1.19
@@ -6,17 +6,24 @@
configure
configure.in
expat_config.h.in
-bcb5/ExpatGroup.bpg
-bcb5/ReadMe.txt
+bcb5/README.txt
bcb5/elements.bpf
bcb5/elements.bpr
bcb5/elements.mak
-bcb5/libexpat.bpf
-bcb5/libexpat.bpr
-bcb5/libexpat.mak
-bcb5/libexpatw.bpf
-bcb5/libexpatw.bpr
-bcb5/libexpatw.mak
+bcb5/expat.bpf
+bcb5/expat.bpr
+bcb5/expat.mak
+bcb5/expat_static.bpf
+bcb5/expat_static.bpr
+bcb5/expat_static.mak
+bcb5/expatw.bpf
+bcb5/expatw.bpr
+bcb5/expatw.mak
+bcb5/expatw_static.bpf
+bcb5/expatw_static.bpr
+bcb5/expatw_static.mak
+bcb5/libexpat_mtd.def
+bcb5/libexpatw_mtd.def
bcb5/makefile.mak
bcb5/outline.bpf
bcb5/outline.bpr
From fdrake at users.sourceforge.net Mon Jan 20 07:25:24 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Mon Jan 20 10:25:28 2003
Subject: [Expat-checkins] expat make-release.sh,1.4,1.5
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv11575
Modified Files:
make-release.sh
Log Message:
- try to be smarter about the options to cp
- use indentation consistently
- one we've built the tarball successfully, clean up the 2nd temp dir
Index: make-release.sh
===================================================================
RCS file: /cvsroot/expat/expat/make-release.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- make-release.sh 25 Jul 2002 15:21:06 -0000 1.4
+++ make-release.sh 20 Jan 2003 15:25:20 -0000 1.5
@@ -33,9 +33,9 @@
echo "Release version: $vsn"
if test "$1" = HEAD ; then
- distdir=expat-`date '+%Y-%m-%d'`
+ distdir=expat-`date '+%Y-%m-%d'`
else
- distdir=expat-$vsn
+ distdir=expat-$vsn
fi
if test -e $distdir; then
echo "ERROR: for safety, you must manually remove $distdir."
@@ -44,13 +44,20 @@
fi
mkdir $distdir || exit 1
+CPOPTS=-Pp
+if (cp --version 2>/dev/null | grep -q 'Free Software Foundation') ; then
+ # If we're using GNU cp, we can avoid the warnings about forward
+ # compatibility of the options.
+ CPOPTS='--parents --preserve'
+fi
+
echo ""
echo "----------------------------------------------------------------------"
echo "Building $distdir based on the MANIFEST:"
files="`sed -e 's/[ ]:.*$//' $tmpdir/MANIFEST`"
for file in $files; do
echo "Copying $file..."
- (cd $tmpdir && cp -Pp $file ../$distdir) || exit 1
+ (cd $tmpdir && cp $CPOPTS $file ../$distdir) || exit 1
done
echo ""
@@ -60,6 +67,7 @@
tarball=$distdir.tar.gz
echo "Constructing $tarball..."
-tar cf - $distdir | gzip -9 > $tarball
+tar cf - $distdir | gzip -9 > $tarball || exit $?
+rm -r $distdir
echo "Done."
From fdrake at users.sourceforge.net Mon Jan 20 21:00:56 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 21 00:01:03 2003
Subject: [Expat-checkins] expat/doc reference.html,1.39,1.40
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv29395
Modified Files:
reference.html
Log Message:
Documented XML_SetExternalEntityRefHandlerArg(), including API
foolishness noted in SF bug #644344.
Closes SF bug #644344.
Index: reference.html
===================================================================
RCS file: /cvsroot/expat/expat/doc/reference.html,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- reference.html 16 Jan 2003 23:15:19 -0000 1.39
+++ reference.html 21 Jan 2003 05:00:51 -0000 1.40
@@ -74,6 +74,7 @@
XML_SetDefaultHandler
XML_SetDefaultHandlerExpand
XML_SetExternalEntityRefHandler
+ XML_SetExternalEntityRefHandlerArg
XML_SetSkippedEntityHandler
XML_SetUnknownEncodingHandler
XML_SetStartNamespaceDeclHandler
@@ -1038,6 +1039,30 @@
Since this handler may be called recursively, it should not be saving
information into global or static variables.
+
+
+
+XML_SetExternalEntityRefHandlerArg(XML_Parser p,
+ void *arg)
+
+
+
Set the argument passed to the ExternalEntityRefHandler. If
+arg
is not NULL, it is the new value passed to the
+handler set using XML_SetExternalEntityRefHandler
; if arg
is
+NULL, the argument passed to the handler function will be the parser
+object itself.
+
+
Note:
+The type of arg
and the type of the first argument to the
+ExternalEntityRefHandler do not match. This function takes a
+void *
to be passed to the handler, while the handler
+accepts an XML_Parser
. This is a historical accident,
+but will not be corrected before Expat 2.0 (at the earliest) to avoid
+causing compiler warnings for code that's known to work with this
+API. It is the responsibility of the application code to know the
+actual type of the argument passed to the handler and to manage it
+properly.
From fdrake at users.sourceforge.net Mon Jan 20 21:20:53 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 21 00:20:55 2003
Subject: [Expat-checkins] htdocs index.html,1.34,1.35
Message-ID:
Update of /cvsroot/expat/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv3689
Modified Files:
index.html
Log Message:
Added link to a discussion of another way to handle stateful
callbacks, using Expat as an example library to work with.
Closes SF bug #658080.
Index: index.html
===================================================================
RCS file: /cvsroot/expat/htdocs/index.html,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- index.html 4 Dec 2002 06:52:36 -0000 1.34
+++ index.html 21 Jan 2003 05:20:51 -0000 1.35
@@ -139,6 +139,11 @@
EasySoap is a C++
SOAP implementation which uses Expat.
+ A discussion of another way to manage stateful callbacks, using
+ Expat as a sample library.
+
The GOBO
project is working on an Eiffel binding for Expat. Development
appears to have slowed, and there isn't any status information about
From fdrake at users.sourceforge.net Mon Jan 20 21:41:28 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 21 00:41:31 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.42,1.43
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv9871
Modified Files:
runtests.c
Log Message:
Fix test case regarding reporting of undefined entities and
non-validating parsers (see section 5.1 of the XML 1.0 specification).
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- runtests.c 20 Jan 2003 14:49:44 -0000 1.42
+++ runtests.c 21 Jan 2003 05:41:24 -0000 1.43
@@ -827,11 +827,11 @@
}
/* Test that an error is reported for unknown entities if we have read
- an external subset.
+ an external subset, and standalone is true.
*/
-START_TEST(test_wfc_undeclared_entity_with_external_subset) {
+START_TEST(test_wfc_undeclared_entity_with_external_subset_standalone) {
char *text =
- "\n"
+ "\n"
"\n"
"&entity; ";
char *foo_text =
@@ -846,6 +846,25 @@
}
END_TEST
+/* Test that no error is reported for unknown entities if we have read
+ an external subset, and standalone is false.
+*/
+START_TEST(test_wfc_undeclared_entity_with_external_subset) {
+ char *text =
+ "\n"
+ "\n"
+ "&entity; ";
+ char *foo_text =
+ "";
+
+ XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+ XML_SetUserData(parser, foo_text);
+ XML_SetExternalEntityRefHandler(parser, external_entity_loader);
+ if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ xml_failure(parser);
+}
+END_TEST
+
START_TEST(test_wfc_no_recursive_entity_refs)
{
char *text =
@@ -1165,6 +1184,8 @@
tcase_add_test(tc_basic, test_wfc_undeclared_entity_no_external_subset);
tcase_add_test(tc_basic, test_wfc_undeclared_entity_standalone);
tcase_add_test(tc_basic, test_wfc_undeclared_entity_with_external_subset);
+ tcase_add_test(tc_basic,
+ test_wfc_undeclared_entity_with_external_subset_standalone);
tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs);
tcase_add_test(tc_basic, test_ext_entity_set_encoding);
tcase_add_test(tc_basic, test_dtd_default_handling);
From fdrake at users.sourceforge.net Tue Jan 21 08:09:35 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 21 11:09:38 2003
Subject: [Expat-checkins] expat/doc reference.html,1.40,1.41
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv14934
Modified Files:
reference.html
Log Message:
Added notes that the namespace decl handlers are only called when the
start element handler is set. See SF bug #620343.
Index: reference.html
===================================================================
RCS file: /cvsroot/expat/expat/doc/reference.html,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- reference.html 21 Jan 2003 05:00:51 -0000 1.40
+++ reference.html 21 Jan 2003 16:09:31 -0000 1.41
@@ -1154,6 +1154,12 @@
declarations occur inside start tags. But the namespace declaration start
handler is called before the start tag handler for each namespace declared
in that start tag.
+
+Note:
+Due to limitations of the implementation, the
+StartNamespaceDeclHandler is not called unless the StartElementHandler
+is also set. The specific value of the StartElementHandler is allowed
+to change freely, so long as it is not NULL.
@@ -1170,6 +1176,12 @@
declaration. This will be called, for each namespace declaration,
after the handler for the end tag of the element in which the
namespace was declared.
+
+
Note:
+Due to limitations of the implementation, the EndNamespaceDeclHandler
+is not called unless the StartElementHandler is also set. The
+specific value of the StartElementHandler is allowed to change freely,
+so long as it is not NULL.
@@ -1179,6 +1191,13 @@
XML_EndNamespaceDeclHandler end)
Sets both namespace declaration handlers with a single call.
+
+
Note:
+Due to limitations of the implementation, the
+StartNamespaceDeclHandler and EndNamespaceDeclHandler are not called
+unless the StartElementHandler is also set. The specific value of the
+StartElementHandler is allowed to change freely, so long as it is not
+NULL.
From fdrake at users.sourceforge.net Tue Jan 21 19:19:24 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 21 22:19:26 2003
Subject: [Expat-checkins] htdocs index.html,1.35,1.36
Message-ID:
Update of /cvsroot/expat/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv32483
Modified Files:
index.html
Log Message:
- update information on the GOBO Expat interface
- fix some well-formedness errors
- add some missing punctuation
Index: index.html
===================================================================
RCS file: /cvsroot/expat/htdocs/index.html,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- index.html 21 Jan 2003 05:20:51 -0000 1.35
+++ index.html 22 Jan 2003 03:19:22 -0000 1.36
@@ -116,7 +116,7 @@
The Simple C Expat Wrapper
is a wrapper around Expat that provides a light-weight object model
- somewhat like a DOM.
+ somewhat like a DOM.
A discussion of another way to manage stateful callbacks, using
- Expat as a sample library.
+ Expat as a sample library.
The GOBO
project is working on an Eiffel binding for Expat. Development
- appears to have slowed, and there isn't any status information about
- the Expat bindings on the website. (I had to dig around the CVS to
- find any hint of the XML support.)
+ is active and the package is fully supported in GOBO 3.0 and 3.1,
+ though there isn't much status information about the Expat bindings
+ on the website. (Most activity is reportedly on the relevant
+ mailing lists.)
The TclXML project includes a tDOM is an alternate package providing XML support for Tcl , based in part on
- Expat
+ Expat.
Objective-C interface to Expat
From kwaclaw at users.sourceforge.net Wed Jan 22 06:26:11 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Wed Jan 22 09:26:13 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.102,1.103
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv8748
Modified Files:
xmlparse.c
Log Message:
Prevent storeAtts() from being called twice for an empty element when
the endElementHandler is set, but not the startElementHandler.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- xmlparse.c 16 Jan 2003 22:03:42 -0000 1.102
+++ xmlparse.c 22 Jan 2003 14:26:07 -0000 1.103
@@ -2123,7 +2123,7 @@
break;
}
case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
- if (!startElementHandler) {
+ if (!startElementHandler && !endElementHandler) {
enum XML_Error result = storeAtts(parser, enc, s, 0, 0);
if (result)
return result;
From kwaclaw at users.sourceforge.net Wed Jan 22 06:52:24 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Wed Jan 22 09:52:27 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.103,1.104
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv30438
Modified Files:
xmlparse.c
Log Message:
For the start of element and end of element events, it is possible that
the default handler does not get called even when no element handlers
are called, because storeAtts() may trigger the startNamespaceDeclHandler
where the application has a chance to clear the element handlers.
This patch fixes this with one issue still open, which applies to empty elements only:
When the endElement handler is called, but not the startElementHandler,
then the default handler is not called, which causes attributes to not
be reported at all. The other alternative would be to call the default handler,
but then the element would be reported twice.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- xmlparse.c 22 Jan 2003 14:26:07 -0000 1.103
+++ xmlparse.c 22 Jan 2003 14:52:20 -0000 1.104
@@ -2116,6 +2116,8 @@
if (startElementHandler)
startElementHandler(handlerArg, tag->name.str,
(const XML_Char **)atts);
+ else if (defaultHandler)
+ reportDefault(parser, enc, s, next);
}
else if (defaultHandler)
reportDefault(parser, enc, s, next);
@@ -2134,6 +2136,7 @@
const char *rawName = s + enc->minBytesPerChar;
enum XML_Error result;
BINDING *bindings = NULL;
+ XML_Bool noElmHandlers = XML_TRUE;
TAG_NAME name;
name.str = poolStoreString(&tempPool, enc, rawName,
rawName + XmlNameLength(enc, rawName));
@@ -2144,13 +2147,18 @@
if (result)
return result;
poolFinish(&tempPool);
- if (startElementHandler)
+ if (startElementHandler) {
startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
+ noElmHandlers = XML_FALSE;
+ }
if (endElementHandler) {
if (startElementHandler)
*eventPP = *eventEndPP;
endElementHandler(handlerArg, name.str);
+ noElmHandlers = XML_FALSE;
}
+ if (noElmHandlers && defaultHandler)
+ reportDefault(parser, enc, s, next);
poolClear(&tempPool);
while (bindings) {
BINDING *b = bindings;
From kwaclaw at users.sourceforge.net Thu Jan 23 21:01:48 2003
From: kwaclaw at users.sourceforge.net (Karl Waclawek)
Date: Fri Jan 24 00:01:51 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.104,1.105
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv10909
Modified Files:
xmlparse.c
Log Message:
Applied patch #673791.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- xmlparse.c 22 Jan 2003 14:52:20 -0000 1.104
+++ xmlparse.c 24 Jan 2003 05:01:45 -0000 1.105
@@ -318,7 +318,7 @@
static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *,
const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
-static int
+static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr);
static int
@@ -2457,9 +2457,10 @@
if (attId->prefix && tagNamePtr) {
if (attId->xmlns) {
/* deal with namespace declarations here */
- if (!addBinding(parser, attId->prefix, attId, appAtts[attIndex],
- bindingsPtr))
- return XML_ERROR_NO_MEMORY;
+ enum XML_Error result = addBinding(parser, attId->prefix, attId,
+ appAtts[attIndex], bindingsPtr);
+ if (result)
+ return result;
--attIndex;
}
else {
@@ -2490,9 +2491,10 @@
if (!(da->id->name)[-1] && da->value) {
if (da->id->prefix) {
if (da->id->xmlns) {
- if (!addBinding(parser, da->id->prefix, da->id, da->value,
- bindingsPtr))
- return XML_ERROR_NO_MEMORY;
+ enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
+ da->value, bindingsPtr);
+ if (result)
+ return result;
}
else {
(da->id->name)[-1] = 2;
@@ -2612,12 +2614,17 @@
/* addBinding() overwrites the value of prefix->binding without checking.
Therefore one must keep track of the old value outside of addBinding().
*/
-static int
+static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr)
{
BINDING *b;
int len;
+
+ /* empty string is only valid when there is no prefix per XML NS 1.0 */
+ if (*uri == XML_T('\0') && prefix->name)
+ return XML_ERROR_SYNTAX;
+
for (len = 0; uri[len]; len++)
;
if (namespaceSeparator)
@@ -2628,7 +2635,7 @@
XML_Char *temp = (XML_Char *)REALLOC(b->uri,
sizeof(XML_Char) * (len + EXPAND_SPARE));
if (temp == NULL)
- return 0;
+ return XML_ERROR_NO_MEMORY;
b->uri = temp;
b->uriAlloc = len + EXPAND_SPARE;
}
@@ -2637,11 +2644,11 @@
else {
b = (BINDING *)MALLOC(sizeof(BINDING));
if (!b)
- return 0;
+ return XML_ERROR_NO_MEMORY;
b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
if (!b->uri) {
FREE(b);
- return 0;
+ return XML_ERROR_NO_MEMORY;
}
b->uriAlloc = len + EXPAND_SPARE;
}
@@ -2661,7 +2668,7 @@
if (startNamespaceDeclHandler)
startNamespaceDeclHandler(handlerArg, prefix->name,
prefix->binding ? uri : 0);
- return 1;
+ return XML_ERROR_NONE;
}
/* The idea here is to avoid using stack for each CDATA section when
@@ -4908,8 +4915,8 @@
return XML_FALSE;
if (!poolAppendChar(&tempPool, XML_T('\0')))
return XML_FALSE;
- if (!addBinding(parser, prefix, 0, poolStart(&tempPool),
- &inheritedBindings))
+ if (addBinding(parser, prefix, 0, poolStart(&tempPool),
+ &inheritedBindings) != XML_ERROR_NONE)
return XML_FALSE;
poolDiscard(&tempPool);
if (*context != XML_T('\0'))
From fdrake at users.sourceforge.net Thu Jan 23 21:09:45 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 00:09:47 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv14134
Modified Files:
runtests.c
Log Message:
Add a test that makes sure xmlns:prefix="" is allowed when namespace
processing is not enabled.
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- runtests.c 21 Jan 2003 05:41:24 -0000 1.43
+++ runtests.c 24 Jan 2003 05:09:42 -0000 1.44
@@ -906,6 +906,24 @@
}
END_TEST
+/* See related SF bug #673791.
+ When namespace processing is enabled, setting the namespace URI for
+ a prefix is not allowed; this test ensures that it *is* allowed
+ when namespace processing is not enabled.
+ (See Namespaces in XML, section 2.)
+*/
+START_TEST(test_empty_ns_without_namespaces)
+{
+ char *text =
+ "\n"
+ " \n"
+ " ";
+
+ if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ xml_failure(parser);
+}
+END_TEST
+
/*
* Namespaces tests.
@@ -1189,6 +1207,7 @@
tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs);
tcase_add_test(tc_basic, test_ext_entity_set_encoding);
tcase_add_test(tc_basic, test_dtd_default_handling);
+ tcase_add_test(tc_basic, test_empty_ns_without_namespaces);
suite_add_tcase(s, tc_namespace);
tcase_add_checked_fixture(tc_namespace,
From fdrake at users.sourceforge.net Thu Jan 23 21:39:19 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 00:39:22 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.44,1.45
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv26377
Modified Files:
runtests.c
Log Message:
- _expect_failure(): Use _fail_unless() instead of fail() to allow
reporting of the right line number
- add test that demonstrates the default namespace can be reset
without a syntax error
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- runtests.c 24 Jan 2003 05:09:42 -0000 1.44
+++ runtests.c 24 Jan 2003 05:39:16 -0000 1.45
@@ -50,7 +50,9 @@
char *file, int lineno)
{
if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_OK)
- fail(errorMessage);
+ /* Hackish use of _fail_unless() macro, but let's us report
+ the right filename and line number. */
+ _fail_unless(0, file, lineno, errorMessage);
if (XML_GetErrorCode(parser) != errorCode)
_xml_failure(parser, file, lineno);
}
@@ -1161,6 +1163,17 @@
}
END_TEST
+START_TEST(test_ns_default_with_empty_uri)
+{
+ char *text =
+ "\n"
+ " \n"
+ " ";
+ if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ xml_failure(parser);
+}
+END_TEST
+
static Suite *
make_basic_suite(void)
{
@@ -1217,6 +1230,7 @@
tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
+ tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
return s;
}
From karl at waclawek.net Fri Jan 24 10:06:44 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 10:07:53 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
Message-ID: <004001c2c3ba$35205540$9e539696@citkwaclaww2k>
Fred,
you said the test didn't work for you.
This patch doesn't show if the parser instance you are using
was created with namespace processing turned on.
Karl
----- Original Message -----
From: "Fred L. Drake"
To:
Sent: Friday, January 24, 2003 12:09 AM
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
> Update of /cvsroot/expat/expat/tests
> In directory sc8-pr-cvs1:/tmp/cvs-serv14134
>
> Modified Files:
> runtests.c
> Log Message:
> Add a test that makes sure xmlns:prefix="" is allowed when namespace
> processing is not enabled.
>
>
> Index: runtests.c
> ===================================================================
> RCS file: /cvsroot/expat/expat/tests/runtests.c,v
> retrieving revision 1.43
> retrieving revision 1.44
> diff -u -d -r1.43 -r1.44
> --- runtests.c 21 Jan 2003 05:41:24 -0000 1.43
> +++ runtests.c 24 Jan 2003 05:09:42 -0000 1.44
> @@ -906,6 +906,24 @@
> }
> END_TEST
>
> +/* See related SF bug #673791.
> + When namespace processing is enabled, setting the namespace URI for
> + a prefix is not allowed; this test ensures that it *is* allowed
> + when namespace processing is not enabled.
> + (See Namespaces in XML, section 2.)
> +*/
> +START_TEST(test_empty_ns_without_namespaces)
> +{
> + char *text =
> + "\n"
> + " \n"
> + " ";
> +
> + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
> + xml_failure(parser);
> +}
> +END_TEST
> +
>
> /*
> * Namespaces tests.
> @@ -1189,6 +1207,7 @@
> tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs);
> tcase_add_test(tc_basic, test_ext_entity_set_encoding);
> tcase_add_test(tc_basic, test_dtd_default_handling);
> + tcase_add_test(tc_basic, test_empty_ns_without_namespaces);
>
> suite_add_tcase(s, tc_namespace);
> tcase_add_checked_fixture(tc_namespace,
>
>
>
> _______________________________________________
> Expat-checkins mailing list
> Expat-checkins@libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-checkins
>
From fdrake at acm.org Fri Jan 24 10:21:21 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 10:22:10 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <004001c2c3ba$35205540$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
Message-ID: <15921.23025.539946.483419@grendel.zope.com>
Karl Waclawek writes:
> you said the test didn't work for you.
> This patch doesn't show if the parser instance you are using
> was created with namespace processing turned on.
It was; the parser being tested in test_ns_prefix_with_empty_uri_[12]
(in the test patch on SF, not committed to CVS) is created using
namespace_setup, which uses XML_ParserCreateNS.
> > Modified Files:
> > runtests.c
> > Log Message:
> > Add a test that makes sure xmlns:prefix="" is allowed when namespace
> > processing is not enabled.
Wrong patch; this test works as expected.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From fdrake at users.sourceforge.net Fri Jan 24 07:23:36 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 10:23:40 2003
Subject: [Expat-checkins] expat/doc xmlwf.sgml,1.2,1.3
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv16784
Modified Files:
xmlwf.sgml
Log Message:
- document unexpected memory use reporting when memory mapped files
are used; closes SF bug #632146
- minor changes to wording in a few places
- remove cute comment on one of the linked sites
- added more markup
Index: xmlwf.sgml
===================================================================
RCS file: /cvsroot/expat/expat/doc/xmlwf.sgml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xmlwf.sgml 13 Jun 2002 18:12:20 -0000 1.2
+++ xmlwf.sgml 24 Jan 2003 15:23:33 -0000 1.3
@@ -79,14 +79,15 @@
DESCRIPTION
- &dhpackage; uses the Expat library to determine
- if an XML document is well-formed. It is non-validating.
+ &dhpackage; uses the Expat library to
+ determine if an XML document is well-formed. It is
+ non-validating.
- If you do not specify any files on the command-line,
- and you have a recent version of &dhpackage;, the input
- file will be read from stdin.
+ If you do not specify any files on the command-line, and you
+ have a recent version of &dhpackage; , the
+ input file will be read from standard input.
@@ -103,7 +104,8 @@
The file begins with an XML declaration. For instance,
<?xml version="1.0" standalone="yes"?> .
- NOTE: &dhpackage; does not currently
+ NOTE:
+ &dhpackage; does not currently
check for a valid XML declaration.
@@ -128,8 +130,9 @@
If the document has a DTD, and it strictly complies with that
DTD, then the document is also considered valid .
- &dhpackage; is a non-validating parser -- it does not check the DTD.
- However, it does support external entities (see the -x option).
+ &dhpackage; is a non-validating parser --
+ it does not check the DTD. However, it does support
+ external entities (see the -x option).
@@ -138,7 +141,9 @@
When an option includes an argument, you may specify the argument either
-separate ("d output") or mashed ("-doutput"). &dhpackage; supports both.
+separately ("-d output") or concatenated with the
+option ("-d output"). &dhpackage;
+supports both.
@@ -147,11 +152,11 @@
-c
- If the input file is well-formed and &dhpackage; doesn't
- encounter any errors, the input file is simply copied to
+ If the input file is well-formed and &dhpackage;
+ 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.
+ This implies no namespaces (turns off -n ) and
+ requires -d to specify an output file.
@@ -162,17 +167,18 @@
Specifies a directory to contain transformed
representations of the input files.
- By default, -d outputs a canonical representation
+ By default, -d outputs a canonical representation
(described below).
- You can select different output formats using -c and -m.
+ 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
+ coming from standard input. Therefore, you must be careful that the
output file does not go into the same directory as the input
- file. Otherwise, &dhpackage; will delete the input file before
- it generates the output file (just like running
+ file. Otherwise, &dhpackage; will delete the
+ input file before it generates the output file (just like running
cat < file > file in most shells).
@@ -191,13 +197,13 @@
Specifies the character encoding for the document, overriding
- any document encoding declaration. &dhpackage;
- has four built-in encodings:
+ any document encoding declaration. &dhpackage;
+ supports four built-in encodings:
US-ASCII ,
UTF-8 ,
UTF-16 , and
- ISO-8859-1 .
- Also see the -w option.
+ ISO-8859-1 .
+ Also see the -w option.
@@ -208,7 +214,7 @@
Outputs some strange sort of XML file that completely
describes the the input file, including character postitions.
- Requires -d to specify an output file.
+ Requires -d to specify an output file.
@@ -218,7 +224,7 @@
Turns on namespace processing. (describe namespaces)
- -c disables namespaces.
+ -c disables namespaces.
@@ -231,9 +237,9 @@
entities.
- Normally &dhpackage; never parses parameter entities.
- -p tells it to always parse them.
- -p implies -x.
+ Normally &dhpackage; never parses parameter
+ entities. -p tells it to always parse them.
+ -p implies -x .
@@ -242,11 +248,21 @@
-r
- Normally &dhpackage; memory-maps the XML file before parsing.
- -r turns off memory-mapping and uses normal file IO calls instead.
+ Normally &dhpackage; memory-maps the XML file
+ before parsing; this can result in faster parsing on many
+ platforms.
+ -r turns off memory-mapping and uses normal file
+ IO calls instead.
Of course, memory-mapping is automatically turned off
- when reading from STDIN.
+ when reading from standard input.
+
+ Use of memory-mapping can cause some platforms to report
+ substantially higher memory usage for
+ &dhpackage; , but this appears to be a matter of
+ the operating system reporting memory in a strange way; there is
+ not a leak in &dhpackage; .
+
@@ -269,7 +285,9 @@
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, ...).
+ -t turns off most of the output options
+ (-d , -m , -c ,
+ ...).
@@ -278,7 +296,9 @@
-v
- Prints the version of the Expat library being used, and then exits.
+ Prints the version of the Expat library being used, including some
+ information on the compile-time configuration of the library, and
+ then exits.
@@ -287,11 +307,11 @@
-w
- Enables Windows code pages.
- Normally, &dhpackage; will throw an error if it runs across
- an encoding that it is not equipped to handle itself. With
- -w, &dhpackage; will try to use a Windows code page. See
- also -e.
+ Enables support for Windows code pages.
+ Normally, &dhpackage; will throw an error if it
+ runs across an encoding that it is not equipped to handle itself. With
+ -w , &dhpackage; will try to use a Windows code
+ page. See also -e .
@@ -334,24 +354,26 @@
--
- For some reason, &dhpackage; specifically ignores "--"
- anywhere it appears on the command line.
+ For some reason, &dhpackage; specifically
+ ignores "--" anywhere it appears on the command line.
- Older versions of &dhpackage; do not support reading from STDIN.
+ Older versions of &dhpackage; do not support
+ reading from standard input.
OUTPUT
- If an input file is not well-formed, &dhpackage; outputs
- a single line describing the problem to STDOUT.
- If a file is well formed, &dhpackage; outputs nothing.
+ If an input file is not well-formed,
+ &dhpackage; prints a single line describing
+ the problem to standard output. If a file is well formed,
+ &dhpackage; outputs nothing.
Note that the result code is not set.
@@ -361,24 +383,28 @@
According to the W3C standard, an XML file without a
declaration at the beginning is not considered well-formed.
- However, &dhpackage; allows this to pass.
+ However, &dhpackage; allows this to pass.
- &dhpackage; 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.
+ &dhpackage; returns a 0 - noerr result,
+ even if the file is not well-formed. There is no good way for
+ a program to use &dhpackage; to quickly
+ check a file -- it must parse &dhpackage; 's
+ standard output.
-
- The errors should go to STDERR, not stdout.
-
- 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.
+ The errors should go to standard error, not standard output.
- 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.
+ There should be a way to get -d to send its
+ output to standard output rather than forcing the user to send
+ it to a file.
+
+
+ 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.
@@ -392,7 +418,6 @@
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
- (on a page with no less than 15 ads! Shame!)
From fdrake at users.sourceforge.net Fri Jan 24 07:26:09 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 10:26:12 2003
Subject: [Expat-checkins] expat/doc xmlwf.1,1.1,1.2
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv18660
Modified Files:
xmlwf.1
Log Message:
Regenerate from xmlwf.sgml.
Index: xmlwf.1
===================================================================
RCS file: /cvsroot/expat/expat/doc/xmlwf.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xmlwf.1 22 Apr 2002 17:03:39 -0000 1.1
+++ xmlwf.1 24 Jan 2003 15:26:06 -0000 1.2
@@ -3,7 +3,7 @@
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
-.TH "XMLWF" "1" "22 April 2002" "" ""
+.TH "XMLWF" "1" "24 January 2003" "" ""
.SH NAME
xmlwf \- Determines if an XML document is well-formed
.SH SYNOPSIS
@@ -12,12 +12,13 @@
.SH "DESCRIPTION"
.PP
-\fBxmlwf\fR uses the Expat library to determine
-if an XML document is well-formed. It is non-validating.
+\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.
+If you do not specify any files on the command-line, and you
+have a recent version of \fBxmlwf\fR, the
+input file will be read from standard input.
.SH "WELL-FORMED DOCUMENTS"
.PP
A well-formed document must adhere to the
@@ -26,7 +27,8 @@
\(bu
The file begins with an XML declaration. For instance,
.
-\fBNOTE:\fR xmlwf does not currently
+\fBNOTE:\fR
+\fBxmlwf\fR does not currently
check for a valid XML declaration.
.TP 0.2i
\(bu
@@ -48,33 +50,37 @@
.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).
+\fBxmlwf\fR is a non-validating parser --
+it does not check the DTD. However, it does support
+external entities (see the \fB-x\fR 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.
+separately ("\fB-d\fR output") or concatenated with the
+option ("\fB-d\fRoutput"). \fBxmlwf\fR
+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
+If the input file is well-formed and \fBxmlwf\fR
+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.
+This implies no namespaces (turns off \fB-n\fR) and
+requires \fB-d\fR 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
+By default, \fB-d\fR outputs a canonical representation
(described below).
-You can select different output formats using -c and -m.
+You can select different output formats using \fB-c\fR
+and \fB-m\fR.
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
+coming from standard input. 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
+file. Otherwise, \fBxmlwf\fR 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
@@ -86,36 +92,45 @@
.TP
\fB-e encoding\fR
Specifies the character encoding for the document, overriding
-any document encoding declaration. xmlwf
-has four built-in encodings:
+any document encoding declaration. \fBxmlwf\fR
+supports four built-in encodings:
US-ASCII,
UTF-8,
UTF-16, and
ISO-8859-1.
-Also see the -w option.
+Also see the \fB-w\fR 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.
+Requires \fB-d\fR to specify an output file.
.TP
\fB-n\fR
Turns on namespace processing. (describe namespaces)
--c disables namespaces.
+\fB-c\fR 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.
+Normally \fBxmlwf\fR never parses parameter
+entities. \fB-p\fR tells it to always parse them.
+\fB-p\fR implies \fB-x\fR.
.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.
+Normally \fBxmlwf\fR memory-maps the XML file
+before parsing; this can result in faster parsing on many
+platforms.
+\fB-r\fR turns off memory-mapping and uses normal file
+IO calls instead.
Of course, memory-mapping is automatically turned off
-when reading from STDIN.
+when reading from standard input.
+
+Use of memory-mapping can cause some platforms to report
+substantially higher memory usage for
+\fBxmlwf\fR, but this appears to be a matter of
+the operating system reporting memory in a strange way; there is
+not a leak in \fBxmlwf\fR.
.TP
\fB-s\fR
Prints an error if the document is not standalone.
@@ -127,17 +142,21 @@
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, ...).
+\fB-t\fR turns off most of the output options
+(\fB-d\fR, \fB-m\fR, \fB-c\fR,
+\&...).
.TP
\fB-v\fR
-Prints the version of the Expat library being used, and then exits.
+Prints the version of the Expat library being used, including some
+information on the compile-time configuration of the library, 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.
+Enables support for Windows code pages.
+Normally, \fBxmlwf\fR will throw an error if it
+runs across an encoding that it is not equipped to handle itself. With
+\fB-w\fR, xmlwf will try to use a Windows code
+page. See also \fB-e\fR.
.TP
\fB-x\fR
Turns on parsing external entities.
@@ -164,34 +183,40 @@
.fi
.TP
\fB--\fR
-For some reason, xmlwf specifically ignores "--"
-anywhere it appears on the command line.
+For some reason, \fBxmlwf\fR specifically
+ignores "--" anywhere it appears on the command line.
.PP
-Older versions of xmlwf do not support reading from STDIN.
+Older versions of \fBxmlwf\fR do not support
+reading from standard input.
.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.
+If an input file is not well-formed,
+\fBxmlwf\fR prints a single line describing
+the problem to standard output. If a file is well formed,
+\fBxmlwf\fR 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.
+However, \fBxmlwf\fR 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.
+\fBxmlwf\fR returns a 0 - noerr result,
+even if the file is not well-formed. There is no good way for
+a program to use \fBxmlwf\fR to quickly
+check a file -- it must parse \fBxmlwf\fR's
+standard output.
.PP
-The errors should go to STDERR, not stdout.
+The errors should go to standard error, not standard output.
.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.
+There should be a way to get \fB-d\fR to send its
+output to standard output 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.
+I have no idea why anyone would want to use the
+\fB-d\fR, \fB-c\fR, and
+\fB-m\fR 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:
@@ -201,3 +226,18 @@
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
+.fi
+.SH "SEE ALSO"
+.PP
+
+.nf
+The Expat home page: http://www.libexpat.org/
+The W3 XML specification: http://www.w3.org/TR/REC-xml
+.fi
+.SH "AUTHOR"
+.PP
+This manual page was written by Scott Bronson for
+the Debian GNU/Linux system (but may be used by others). Permission is
+granted to copy, distribute and/or modify this document under
+the terms of the GNU Free Documentation
+License, Version 1.1.
From karl at waclawek.net Fri Jan 24 10:41:06 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 10:41:14 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
Message-ID: <003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
>
> Karl Waclawek writes:
> > you said the test didn't work for you.
> > This patch doesn't show if the parser instance you are using
> > was created with namespace processing turned on.
>
> It was; the parser being tested in test_ns_prefix_with_empty_uri_[12]
> (in the test patch on SF, not committed to CVS) is created using
> namespace_setup, which uses XML_ParserCreateNS.
>
> > > Modified Files:
> > > runtests.c
> > > Log Message:
> > > Add a test that makes sure xmlns:prefix="" is allowed when namespace
> > > processing is not enabled.
>
> Wrong patch; this test works as expected.
Should have looked more closely before.
You are using thee wrong type of document.
xmlns='' is OK, but xmlns:pre='' is not.
This is Jeremy's test document:
Karl
From fdrake at acm.org Fri Jan 24 11:01:16 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 11:01:52 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
<003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
Message-ID: <15921.25420.271424.657004@grendel.zope.com>
Karl Waclawek writes:
> Should have looked more closely before.
> You are using thee wrong type of document.
>
> xmlns='' is OK, but xmlns:pre='' is not.
You're still looking at the wrong test; test_ns_default_with_empty_uri
passes as expected.
> This is Jeremy's test document:
>
>
>
If I modify test_ns_prefix_with_empty_uri_2 to use exactly this
document:
/* Regression test #2 for SF bug #673791. */
START_TEST(test_ns_prefix_with_empty_uri_2)
{
char *text =
"\n"
" ";
expect_failure(text,
XML_ERROR_SYNTAX,
"Did not report setting namespace URI with prefix to ''.");
}
END_TEST
...the test fails. Is this test wrong?
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From fdrake at users.sourceforge.net Fri Jan 24 08:21:49 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 11:21:52 2003
Subject: [Expat-checkins] expat Makefile.in,1.41,1.42
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv16646
Modified Files:
Makefile.in
Log Message:
Add a clobber target. "clean" should really be less destructive, but
libtool is really a thorn with regard to this.
Index: Makefile.in
===================================================================
RCS file: /cvsroot/expat/expat/Makefile.in,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- Makefile.in 7 Nov 2002 21:48:05 -0000 1.41
+++ Makefile.in 24 Jan 2003 16:21:46 -0000 1.42
@@ -59,6 +59,8 @@
rm -rf .libs libexpat.la
rm -f examples/core tests/core xmlwf/core
+clobber: clean
+
distclean: clean
rm -f expat_config.h config.status config.log config.cache libtool
rm -f Makefile
From karl at waclawek.net Fri Jan 24 11:32:42 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 11:32:58 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
<15921.25420.271424.657004@grendel.zope.com>
Message-ID: <000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
> Karl Waclawek writes:
> > Should have looked more closely before.
> > You are using thee wrong type of document.
> >
> > xmlns='' is OK, but xmlns:pre='' is not.
>
> You're still looking at the wrong test; test_ns_default_with_empty_uri
> passes as expected.
>
> > This is Jeremy's test document:
> >
> >
> >
>
> If I modify test_ns_prefix_with_empty_uri_2 to use exactly this
> document:
>
> /* Regression test #2 for SF bug #673791. */
> START_TEST(test_ns_prefix_with_empty_uri_2)
> {
> char *text =
> "\n"
> " ";
>
> expect_failure(text,
> XML_ERROR_SYNTAX,
> "Did not report setting namespace URI with prefix to ''.");
> }
> END_TEST
>
> ...the test fails. Is this test wrong?
I am confused now - I never saw a test case that checks that
Jeremy's document is in error.
Your two test cases so far, check that:
- default namespace can be empty,
- xmlns:prefix='' is allowed when namespace processing is turned off
Am I right?
Now, we need a test case that checks that xmlns:prefix='' is
an error when namespace processing is on. This newest test case
above seems to be the one.
What do you mean with : this test fails?
I mean: Expat should return an error and the test case should
expect that error. Are you saying that in the above test case,
Expat does *not* return an error?
Karl
From fdrake at acm.org Fri Jan 24 12:01:06 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 12:02:22 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
<003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
<15921.25420.271424.657004@grendel.zope.com>
<000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
Message-ID: <15921.29010.351519.214244@grendel.zope.com>
Karl Waclawek writes:
> I am confused now - I never saw a test case that checks that
> Jeremy's document is in error.
That's a modified version of the test attached to the issue on SF.
> Your two test cases so far, check that:
> - default namespace can be empty,
> - xmlns:prefix='' is allowed when namespace processing is turned off
Those are tests that pass and are already checked in. Those are fine
before and after the patch.
> Am I right?
> Now, we need a test case that checks that xmlns:prefix='' is
> an error when namespace processing is on. This newest test case
> above seems to be the one.
>
> What do you mean with : this test fails?
> I mean: Expat should return an error and the test case should
> expect that error. Are you saying that in the above test case,
> Expat does *not* return an error?
That's right; the test expects and error and does not get one, so it
reports a failure (that Expat did not report the error).
I've attached my current version of the new tests.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
-------------- next part --------------
Index: tests/runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.45
diff -u -d -r1.45 runtests.c
--- tests/runtests.c 24 Jan 2003 05:39:16 -0000 1.45
+++ tests/runtests.c 24 Jan 2003 17:00:00 -0000
@@ -1163,6 +1163,34 @@
}
END_TEST
+/* Regression test #1 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_1)
+{
+ char *text =
+ "\n"
+ " \n"
+ " ";
+
+ expect_failure(text,
+ XML_ERROR_SYNTAX,
+ "Did not report re-setting namespace"
+ " URI with prefix to ''.");
+}
+END_TEST
+
+/* Regression test #2 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_2)
+{
+ char *text =
+ "\n"
+ " ";
+
+ expect_failure(text,
+ XML_ERROR_SYNTAX,
+ "Did not report setting namespace URI with prefix to ''.");
+}
+END_TEST
+
START_TEST(test_ns_default_with_empty_uri)
{
char *text =
@@ -1230,6 +1258,8 @@
tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
return s;
From karl at waclawek.net Fri Jan 24 13:08:24 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 13:08:35 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k><15921.25420.271424.657004@grendel.zope.com><000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
Message-ID: <000b01c2c3d3$96801f50$9e539696@citkwaclaww2k>
> > What do you mean with : this test fails?
> > I mean: Expat should return an error and the test case should
> > expect that error. Are you saying that in the above test case,
> > Expat does *not* return an error?
>
> That's right; the test expects and error and does not get one, so it
> reports a failure (that Expat did not report the error).
>
> I've attached my current version of the new tests.
I have checked the documents you use in your test below, and they produce
errors for me. We must be overlooking something.
I am not familiar with the test case framework, but at a first look
it appears to be correctly used for these test cases.
Karl
--------------------------------------------------------------------------------
> Index: tests/runtests.c
> ===================================================================
> RCS file: /cvsroot/expat/expat/tests/runtests.c,v
> retrieving revision 1.45
> diff -u -d -r1.45 runtests.c
> --- tests/runtests.c 24 Jan 2003 05:39:16 -0000 1.45
> +++ tests/runtests.c 24 Jan 2003 17:00:00 -0000
> @@ -1163,6 +1163,34 @@
> }
> END_TEST
>
> +/* Regression test #1 for SF bug #673791. */
> +START_TEST(test_ns_prefix_with_empty_uri_1)
> +{
> + char *text =
> + "\n"
> + " \n"
> + " ";
> +
> + expect_failure(text,
> + XML_ERROR_SYNTAX,
> + "Did not report re-setting namespace"
> + " URI with prefix to ''.");
> +}
> +END_TEST
> +
> +/* Regression test #2 for SF bug #673791. */
> +START_TEST(test_ns_prefix_with_empty_uri_2)
> +{
> + char *text =
> + "\n"
> + " ";
> +
> + expect_failure(text,
> + XML_ERROR_SYNTAX,
> + "Did not report setting namespace URI with prefix to ''.");
> +}
> +END_TEST
> +
> START_TEST(test_ns_default_with_empty_uri)
> {
> char *text =
> @@ -1230,6 +1258,8 @@
> tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
> tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
> tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
> + tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
> + tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
> tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
>
> return s;
>
From fdrake at users.sourceforge.net Fri Jan 24 10:34:15 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 13:34:28 2003
Subject: [Expat-checkins] expat/doc xmlwf.sgml,1.3,1.4
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv8434
Modified Files:
xmlwf.sgml
Log Message:
Explain "--" properly.
Index: xmlwf.sgml
===================================================================
RCS file: /cvsroot/expat/expat/doc/xmlwf.sgml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xmlwf.sgml 24 Jan 2003 15:23:33 -0000 1.3
+++ xmlwf.sgml 24 Jan 2003 18:34:03 -0000 1.4
@@ -354,8 +354,16 @@
--
- For some reason, &dhpackage; specifically
- ignores "--" anywhere it appears on the command line.
+ (Two hyphens.)
+ Terminates the list of options. This is only needed if a filename
+ starts with a hyphen. For example:
+
+
+&dhpackage; -- -myfile.xml
+
+
+ will run &dhpackage; on the file
+ -myfile.xml .
From fdrake at users.sourceforge.net Fri Jan 24 10:35:02 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 13:35:05 2003
Subject: [Expat-checkins] expat/doc xmlwf.1,1.2,1.3
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv8748
Modified Files:
xmlwf.1
Log Message:
Regenerate from xmlwf.sgml revision 1.4.
Index: xmlwf.1
===================================================================
RCS file: /cvsroot/expat/expat/doc/xmlwf.1,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xmlwf.1 24 Jan 2003 15:26:06 -0000 1.2
+++ xmlwf.1 24 Jan 2003 18:34:59 -0000 1.3
@@ -183,8 +183,16 @@
.fi
.TP
\fB--\fR
-For some reason, \fBxmlwf\fR specifically
-ignores "--" anywhere it appears on the command line.
+(Two hyphens.)
+Terminates the list of options. This is only needed if a filename
+starts with a hyphen. For example:
+
+.nf
+xmlwf -- -myfile.xml
+.fi
+
+will run \fBxmlwf\fR on the file
+\fI-myfile.xml\fR.
.PP
Older versions of \fBxmlwf\fR do not support
reading from standard input.
From fdrake at users.sourceforge.net Fri Jan 24 10:43:25 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 13:43:30 2003
Subject: [Expat-checkins] expat Changes,1.31,1.32
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv11593
Modified Files:
Changes
Log Message:
Last minute updates.
Index: Changes
===================================================================
RCS file: /cvsroot/expat/expat/Changes,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- Changes 16 Jan 2003 23:24:38 -0000 1.31
+++ Changes 24 Jan 2003 18:43:20 -0000 1.32
@@ -1,8 +1,9 @@
-Release 1.95.6
+Release 1.95.6 Fri Jan 24 2003
- Added XML_FreeContentModel().
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
- Fixed a variety of bugs: see SF issues 615606, 616863, 618199.
- Enhanced the regression test suite.
+ - Man page improvements: includes SF issue 632146.
Release 1.95.5 Fri Sep 6 2002
- Added XML_UseForeignDTD() for improved SAX2 support.
From karl at waclawek.net Fri Jan 24 13:49:58 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 13:50:06 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k><15921.25420.271424.657004@grendel.zope.com><000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
Message-ID: <004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
>
> That's right; the test expects and error and does not get one, so it
> reports a failure (that Expat did not report the error).
>
> I've attached my current version of the new tests.
Fred,
I looked at:
namespace_setup(void)
{
parser = XML_ParserCreateNS(NULL, ' ');
if (parser == NULL)
fail("Parser not created.");
}
I am not sure this has anything to do with it,
but try a character other than a blank.
I am always using the equivalent of
parser = XML_ParserCreateNS(NULL, '^');
Karl
From fdrake at acm.org Fri Jan 24 13:54:24 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 13:55:11 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
<003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
<15921.25420.271424.657004@grendel.zope.com>
<000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
<004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
Message-ID: <15921.35808.513791.904745@grendel.zope.com>
Karl Waclawek writes:
> I am not sure this has anything to do with it,
> but try a character other than a blank.
> I am always using the equivalent of
>
> parser = XML_ParserCreateNS(NULL, '^');
No change. I get the same results using "xmlwf -n", which uses '\1'
for the separator character. Hmm. ;-(
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From karl at waclawek.net Fri Jan 24 13:56:07 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 13:56:12 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k><15921.25420.271424.657004@grendel.zope.com><000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
<004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
Message-ID: <001101c2c3da$406e1c00$9e539696@citkwaclaww2k>
>
> I am not sure this has anything to do with it,
> but try a character other than a blank.
> I am always using the equivalent of
>
> parser = XML_ParserCreateNS(NULL, '^');
And I forgot to mention: I have always ns_triplets turned on.
Karl
From karl at waclawek.net Fri Jan 24 14:03:39 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 14:03:45 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k><15921.25420.271424.657004@grendel.zope.com><000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k><15921.29010.351519.214244@grendel.zope.com><004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
<15921.35808.513791.904745@grendel.zope.com>
Message-ID: <002501c2c3db$4de43210$9e539696@citkwaclaww2k>
> Karl Waclawek writes:
> > I am not sure this has anything to do with it,
> > but try a character other than a blank.
> > I am always using the equivalent of
> >
> > parser = XML_ParserCreateNS(NULL, '^');
>
> No change. I get the same results using "xmlwf -n", which uses '\1'
> for the separator character. Hmm. ;-(
Now you have got me stumped.
No error when using xmlwf, but error with my own app.
Karl
From fdrake at acm.org Fri Jan 24 14:07:53 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 14:08:27 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <002501c2c3db$4de43210$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
<003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
<15921.25420.271424.657004@grendel.zope.com>
<000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
<004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
<15921.35808.513791.904745@grendel.zope.com>
<002501c2c3db$4de43210$9e539696@citkwaclaww2k>
Message-ID: <15921.36617.175230.734969@grendel.zope.com>
Karl Waclawek writes:
> Now you have got me stumped.
> No error when using xmlwf, but error with my own app.
Do *you* see the non-reporting of an error with xmlwf as well?
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From karl at waclawek.net Fri Jan 24 14:13:19 2003
From: karl at waclawek.net (Karl Waclawek)
Date: Fri Jan 24 14:13:24 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k><15921.23025.539946.483419@grendel.zope.com><003101c2c3bf$022eda30$9e539696@citkwaclaww2k><15921.25420.271424.657004@grendel.zope.com><000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k><15921.29010.351519.214244@grendel.zope.com><004b01c2c3d9$64efc570$9e539696@citkwaclaww2k><15921.35808.513791.904745@grendel.zope.com><002501c2c3db$4de43210$9e539696@citkwaclaww2k>
<15921.36617.175230.734969@grendel.zope.com>
Message-ID: <005a01c2c3dc$a7d23d70$9e539696@citkwaclaww2k>
> Karl Waclawek writes:
> > Now you have got me stumped.
> > No error when using xmlwf, but error with my own app.
>
> Do *you* see the non-reporting of an error with xmlwf as well?
>
Yes, that is what I am saying.
With xmlwf it does not report the error where it should.
However, my own app *does* report an error on the same file.
Now - quick thought: Didn't we just document that
the startNameSpaceDeclHandler does not get called
when no startElementHandler is set? And isn't
addBinding (the function which checks for the error)
the one that would be called to call the startNamespaceDeclHandler?
Try adding a startElementHandler.
Karl
From fdrake at acm.org Fri Jan 24 14:19:56 2003
From: fdrake at acm.org (Fred L. Drake, Jr.)
Date: Fri Jan 24 14:33:17 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.43,1.44
In-Reply-To: <005a01c2c3dc$a7d23d70$9e539696@citkwaclaww2k>
References:
<004001c2c3ba$35205540$9e539696@citkwaclaww2k>
<15921.23025.539946.483419@grendel.zope.com>
<003101c2c3bf$022eda30$9e539696@citkwaclaww2k>
<15921.25420.271424.657004@grendel.zope.com>
<000f01c2c3c6$37dac3e0$9e539696@citkwaclaww2k>
<15921.29010.351519.214244@grendel.zope.com>
<004b01c2c3d9$64efc570$9e539696@citkwaclaww2k>
<15921.35808.513791.904745@grendel.zope.com>
<002501c2c3db$4de43210$9e539696@citkwaclaww2k>
<15921.36617.175230.734969@grendel.zope.com>
<005a01c2c3dc$a7d23d70$9e539696@citkwaclaww2k>
Message-ID: <15921.37340.996557.85363@grendel.zope.com>
Karl Waclawek writes:
> Now - quick thought: Didn't we just document that
> the startNameSpaceDeclHandler does not get called
> when no startElementHandler is set? And isn't
> addBinding (the function which checks for the error)
> the one that would be called to call the startNamespaceDeclHandler?
>
> Try adding a startElementHandler.
Aha! Works like a charm! So it seems the check for an empty URL
needs to happen sooner, outside any dependence on the callbacks, since
this isn't a reporting issue but non-conformance with the "Namespaces
in XML" specification.
-Fred
--
Fred L. Drake, Jr.
PythonLabs at Zope Corporation
From fdrake at users.sourceforge.net Fri Jan 24 20:57:46 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Fri Jan 24 23:57:50 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.45,1.46
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv657
Modified Files:
runtests.c
Log Message:
Thread the proper file name and line number to make determination of
which test is failing easier.
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- runtests.c 24 Jan 2003 05:39:16 -0000 1.45
+++ runtests.c 25 Jan 2003 04:57:44 -0000 1.46
@@ -40,7 +40,7 @@
XML_GetCurrentLineNumber(parser),
XML_GetCurrentColumnNumber(parser),
file, line);
- fail(buffer);
+ _fail_unless(0, file, line, buffer);
}
#define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__)
@@ -199,7 +199,8 @@
static void
-run_character_check(XML_Char *text, XML_Char *expected)
+_run_character_check(XML_Char *text, XML_Char *expected,
+ const char *file, int line)
{
CharData storage;
@@ -207,12 +208,16 @@
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
- xml_failure(parser);
+ _xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
+#define run_character_check(text, expected) \
+ _run_character_check(text, expected, __FILE__, __LINE__)
+
static void
-run_attribute_check(XML_Char *text, XML_Char *expected)
+_run_attribute_check(XML_Char *text, XML_Char *expected,
+ const char *file, int line)
{
CharData storage;
@@ -220,9 +225,12 @@
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
- xml_failure(parser);
+ _xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
+
+#define run_attribute_check(text, expected) \
+ _run_attribute_check(text, expected, __FILE__, __LINE__)
/* Regression test for SF bug #491986. */
START_TEST(test_danish_latin1)
From fdrake at users.sourceforge.net Fri Jan 24 22:55:27 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 02:35:58 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.46,1.47
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv22821/tests
Modified Files:
runtests.c
Log Message:
Added regression tests for SF bug #673791.
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- runtests.c 25 Jan 2003 04:57:44 -0000 1.46
+++ runtests.c 25 Jan 2003 06:55:25 -0000 1.47
@@ -1171,6 +1171,34 @@
}
END_TEST
+/* Regression test #1 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_1)
+{
+ char *text =
+ "\n"
+ " \n"
+ " ";
+
+ expect_failure(text,
+ XML_ERROR_SYNTAX,
+ "Did not report re-setting namespace"
+ " URI with prefix to ''.");
+}
+END_TEST
+
+/* Regression test #2 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_2)
+{
+ char *text =
+ "\n"
+ " ";
+
+ expect_failure(text,
+ XML_ERROR_SYNTAX,
+ "Did not report setting namespace URI with prefix to ''.");
+}
+END_TEST
+
START_TEST(test_ns_default_with_empty_uri)
{
char *text =
@@ -1238,6 +1266,8 @@
tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
return s;
From fdrake at users.sourceforge.net Fri Jan 24 22:53:07 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 02:41:01 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.105,1.106
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv22135/lib
Modified Files:
xmlparse.c
Log Message:
Karl's fix for SF bug #673791:
Error with xmlns:prefix= with namespace processing enabled.
It seems that storeAtts() has the following properties:
- when called with tagNamePtr = NULL and bindingsPtr = NULL,
it does not process attributes incl. namespace declarations
- when called with all arguments non-NULL it processes
attributes (incl. default attributes) and namespace declarations
We also have these requirements:
A) for start of element event:
1) if we have a startElementHandler:
we need to process at least default attributes,
so we must call storeAtts with all arguments non-NULL
2) if we have no startElementHandler, but we have attributes:
we need to process namespace declarations,
so we must call storeAtts with all arguments non-NULL
3) if we have no startElementHandler and no attributes:
we need to store the name (for the end element event, where
the names are compared) and call only the default handler
Note: Storing the name is a pre-requisiste for calling
storeAtts with all arguments non-NULL.
So there really is no place for calling storeAtts with
tagNamePtr = NULL and bindingsPtr = NULL.
B) for empty element event:
1) if we have a startElementHandler:
we need to process at least default attributes,
so we must call storeAtts with all arguments non-NULL
2) if we have no startElementHandler, but we have attributes:
we need to process namespace declarations,
so we must call storeAtts with all arguments non-NULL
3) if we have no startElementHandler and no attributes,
but we have an endElementHandler:
we need to store the name for calling the handler,
but we need not process any attributes (default or not)
4) if we have no start- or endElementHandler, and no attributes:
we need to call only the default handler
Given that storeAtts will now always be called with all arguments
non-NULL we could remove a few internal checks in storeAtts,
if that improves efficiency. Not sure if that is worth it.
This patch should therefore fix the problem of namespace declarations
not being processed when no startElementHandler is set, that is,
it will fix Jeremy's NS processing patch.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- xmlparse.c 24 Jan 2003 05:01:45 -0000 1.105
+++ xmlparse.c 25 Jan 2003 06:53:05 -0000 1.106
@@ -2046,14 +2046,9 @@
reportDefault(parser, enc, s, next);
break;
}
- case XML_TOK_START_TAG_WITH_ATTS:
- if (!startElementHandler) {
- enum XML_Error result = storeAtts(parser, enc, s, 0, 0);
- if (result)
- return result;
- }
- /* fall through */
case XML_TOK_START_TAG_NO_ATTS:
+ /* fall through */
+ case XML_TOK_START_TAG_WITH_ATTS:
{
TAG *tag;
enum XML_Error result;
@@ -2109,30 +2104,33 @@
}
tag->name.str = (XML_Char *)tag->buf;
*toPtr = XML_T('\0');
- if (startElementHandler) {
- result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
- if (result)
- return result;
- if (startElementHandler)
- startElementHandler(handlerArg, tag->name.str,
- (const XML_Char **)atts);
- else if (defaultHandler)
+ if (!startElementHandler && (tok == XML_TOK_START_TAG_NO_ATTS)) {
+ if (defaultHandler)
reportDefault(parser, enc, s, next);
+ break;
}
+ result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
+ if (result)
+ return result;
+ if (startElementHandler)
+ startElementHandler(handlerArg, tag->name.str,
+ (const XML_Char **)atts);
else if (defaultHandler)
reportDefault(parser, enc, s, next);
poolClear(&tempPool);
break;
}
- case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
+ case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
if (!startElementHandler && !endElementHandler) {
- enum XML_Error result = storeAtts(parser, enc, s, 0, 0);
- if (result)
- return result;
+ if (defaultHandler)
+ reportDefault(parser, enc, s, next);
+ if (tagLevel == 0)
+ return epilogProcessor(parser, next, end, nextPtr);
+ break;
}
/* fall through */
- case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
- if (startElementHandler || endElementHandler) {
+ case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
+ {
const char *rawName = s + enc->minBytesPerChar;
enum XML_Error result;
BINDING *bindings = NULL;
@@ -2143,10 +2141,13 @@
if (!name.str)
return XML_ERROR_NO_MEMORY;
poolFinish(&tempPool);
- result = storeAtts(parser, enc, s, &name, &bindings);
- if (result)
- return result;
- poolFinish(&tempPool);
+ if (startElementHandler ||
+ (tok == XML_TOK_EMPTY_ELEMENT_WITH_ATTS)) {
+ result = storeAtts(parser, enc, s, &name, &bindings);
+ if (result)
+ return result;
+ poolFinish(&tempPool);
+ }
if (startElementHandler) {
startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
noElmHandlers = XML_FALSE;
@@ -2170,8 +2171,6 @@
b->prefix->binding = b->prevPrefixBinding;
}
}
- else if (defaultHandler)
- reportDefault(parser, enc, s, next);
if (tagLevel == 0)
return epilogProcessor(parser, next, end, nextPtr);
break;
From fdrake at users.sourceforge.net Sat Jan 25 07:33:24 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 10:33:26 2003
Subject: [Expat-checkins] expat Changes,1.32,1.33
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv11786
Modified Files:
Changes
Log Message:
Update information on the 1.95.6 release (still pending).
Index: Changes
===================================================================
RCS file: /cvsroot/expat/expat/Changes,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Changes 24 Jan 2003 18:43:20 -0000 1.32
+++ Changes 25 Jan 2003 15:33:21 -0000 1.33
@@ -1,7 +1,8 @@
-Release 1.95.6 Fri Jan 24 2003
+Release 1.95.6 Sat Jan 25 2003
- Added XML_FreeContentModel().
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
- - Fixed a variety of bugs: see SF issues 615606, 616863, 618199.
+ - Fixed a variety of bugs: see SF issues 615606, 616863,
+ 618199, 653180, 673791.
- Enhanced the regression test suite.
- Man page improvements: includes SF issue 632146.
From fdrake at users.sourceforge.net Sat Jan 25 07:36:33 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 10:36:37 2003
Subject: [Expat-checkins] expat expat.spec,1.8,1.9
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv13512
Modified Files:
expat.spec
Log Message:
Update for release 1.95.6.
Index: expat.spec
===================================================================
RCS file: /cvsroot/expat/expat/expat.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- expat.spec 5 Sep 2002 04:17:25 -0000 1.8
+++ expat.spec 25 Jan 2003 15:36:31 -0000 1.9
@@ -1,4 +1,4 @@
-%define version 1.95.5
+%define version 1.95.6
%define release 1
Summary: Expat is an XML 1.0 parser written in C.
@@ -38,6 +38,10 @@
/usr/man/man1/xmlwf.1.gz
%changelog
+* Sat Jan 25 2003 Fred L. Drake, Jr.
+[Release 1.95.6-1]
+- Updated for the 1.95.6 release.
+
* Wed Sep 4 2002 Fred L. Drake, Jr.
[Release 1.95.5-1]
- Updated for the 1.95.5 release.
From fdrake at users.sourceforge.net Sat Jan 25 08:10:17 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 11:10:21 2003
Subject: [Expat-checkins] expat/win32 expat.iss,1.13,1.14
Message-ID:
Update of /cvsroot/expat/expat/win32
In directory sc8-pr-cvs1:/tmp/cvs-serv1635
Modified Files:
expat.iss
Log Message:
Update more version numbers.
Index: expat.iss
===================================================================
RCS file: /cvsroot/expat/expat/win32/expat.iss,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- expat.iss 6 Sep 2002 20:30:45 -0000 1.13
+++ expat.iss 25 Jan 2003 16:10:15 -0000 1.14
@@ -7,15 +7,15 @@
[Setup]
AppName=expat
AppId=expat
-AppVersion=1.95.5
-AppVerName=expat 1.95.5
+AppVersion=1.95.6
+AppVerName=expat 1.95.6
AppCopyright=Copyright © 1998-2002 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
-DefaultDirName={sd}\Expat-1.95.5
+DefaultDirName={sd}\Expat-1.95.6
AppPublisher=The Expat Developers
AppPublisherURL=http://www.libexpat.org/
AppSupportURL=http://www.libexpat.org/
AppUpdatesURL=http://www.libexpat.org/
-UninstallDisplayName=Expat XML Parser (version 1.95.5)
+UninstallDisplayName=Expat XML Parser (version 1.95.6)
UninstallFilesDir={app}\Uninstall
Compression=bzip/9
From fdrake at users.sourceforge.net Sat Jan 25 08:25:36 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 11:25:39 2003
Subject: [Expat-checkins] expat/win32 MANIFEST.txt,1.4,1.5
Message-ID:
Update of /cvsroot/expat/expat/win32
In directory sc8-pr-cvs1:/tmp/cvs-serv11744
Modified Files:
MANIFEST.txt
Log Message:
Replace tabs with spaces.
Index: MANIFEST.txt
===================================================================
RCS file: /cvsroot/expat/expat/win32/MANIFEST.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- MANIFEST.txt 6 Sep 2002 20:32:10 -0000 1.4
+++ MANIFEST.txt 25 Jan 2003 16:25:34 -0000 1.5
@@ -15,7 +15,7 @@
\Libs\ Pre-compiled dynamic libraries for developers.
- \StaticLibs\ Pre-compiled static libraries for developers.
+ \StaticLibs\ Pre-compiled static libraries for developers.
\Source\ Source code, which may interest some developers,
including a workspace for Microsft Visual C++.
From fdrake at users.sourceforge.net Sat Jan 25 10:43:31 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 13:43:35 2003
Subject: [Expat-checkins] htdocs index.html,1.36,1.37
Message-ID:
Update of /cvsroot/expat/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv16575
Modified Files:
index.html
Log Message:
Added change notes for Expat 1.95.6, in preparation for pending
release. This should not be published in the release is made public
on SourceForge.
Index: index.html
===================================================================
RCS file: /cvsroot/expat/htdocs/index.html,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- index.html 22 Jan 2003 03:19:22 -0000 1.36
+++ index.html 25 Jan 2003 18:43:29 -0000 1.37
@@ -52,6 +52,22 @@
News
+ 25 January 2003 ,
+ Expat 1.95.6 released.
+
+
+
+ Added XML_FreeContentModel()
.
+ Added XML_MemMalloc()
,
+ XML_MemRealloc()
,
+ XML_MemFree()
.
+ Fixed a variety of bugs: see SF issues 615606, 616863,
+ 618199, 653180, 673791.
+ Enhanced the regression test suite.
+ Man page improvements: includes SF issue 632146.
+
+
+
6 September 2002 ,
Expat 1.95.5 released.
From fdrake at users.sourceforge.net Sat Jan 25 17:11:31 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Sat Jan 25 20:11:34 2003
Subject: [Expat-checkins] expat/win32 expat.iss,1.14,1.15
Message-ID:
Update of /cvsroot/expat/expat/win32
In directory sc8-pr-cvs1:/tmp/cvs-serv9960
Modified Files:
expat.iss
Log Message:
Add the .DEF files to the Windows installer.
Index: expat.iss
===================================================================
RCS file: /cvsroot/expat/expat/win32/expat.iss,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- expat.iss 25 Jan 2003 16:10:15 -0000 1.14
+++ expat.iss 26 Jan 2003 01:11:29 -0000 1.15
@@ -45,6 +45,7 @@
CopyMode: alwaysoverwrite; Source: bcb5\*.*; DestDir: "{app}\Source\bcb5"
CopyMode: alwaysoverwrite; Source: lib\*.c; DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: lib\*.h; DestDir: "{app}\Source\lib"
+CopyMode: alwaysoverwrite; Source: lib\*.def; DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: lib\*.dsp; DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: examples\*.c; DestDir: "{app}\Source\examples"
CopyMode: alwaysoverwrite; Source: examples\*.dsp; DestDir: "{app}\Source\examples"
From fdrake at users.sourceforge.net Mon Jan 27 21:33:40 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 00:33:44 2003
Subject: [Expat-checkins] expat/tests runtests.c,1.47,1.48
Message-ID:
Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv10410
Modified Files:
runtests.c
Log Message:
- two more tests based on Karl's comments on SF patch #673791
- pass XML_TRUE or XML_FALSE as the isFinal parameter for XML_Parse()
Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- runtests.c 25 Jan 2003 06:55:25 -0000 1.47
+++ runtests.c 28 Jan 2003 05:33:37 -0000 1.48
@@ -49,7 +49,7 @@
_expect_failure(char *text, enum XML_Error errorCode, char *errorMessage,
char *file, int lineno)
{
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_OK)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_OK)
/* Hackish use of _fail_unless() macro, but let's us report
the right filename and line number. */
_fail_unless(0, file, lineno, errorMessage);
@@ -135,7 +135,7 @@
char text[] = "\0 ";
/* test that a NUL byte (in US-ASCII data) is an error */
- if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_OK)
+ if (XML_Parse(parser, text, sizeof(text) - 1, XML_TRUE) == XML_STATUS_OK)
fail("Parser did not report error on NUL-byte.");
if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
xml_failure(parser);
@@ -157,7 +157,7 @@
/* This test is really just making sure we don't core on a UTF-8 BOM. */
char *text = "\357\273\277 ";
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -166,7 +166,7 @@
{
char text[] = "\376\377\0<\0e\0/\0>";
- if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, sizeof(text)-1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -175,7 +175,7 @@
{
char text[] = "\377\376<\0e\0/\0>\0";
- if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, sizeof(text)-1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -207,7 +207,7 @@
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetCharacterDataHandler(parser, accumulate_characters);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
_xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
@@ -224,7 +224,7 @@
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, accumulate_attribute);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
_xml_failure(parser, file, line);
CharData_CheckXMLChars(&storage, expected);
}
@@ -308,7 +308,7 @@
for (i = 128; i <= 255; ++i) {
sprintf(text, "%ccd ", i);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_OK) {
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_OK) {
sprintf(text,
"expected token error for '%c' (ordinal %d) in UTF-8 text",
i, i);
@@ -335,7 +335,7 @@
"\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_STATUS_ERROR)
+ if (XML_Parse(parser, text, sizeof(text)-1, XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -350,12 +350,13 @@
if (first_chunk_bytes >= sizeof(text) - 1)
fail("bad value of first_chunk_bytes");
- if (XML_Parse(parser, text, first_chunk_bytes, 0) == XML_STATUS_ERROR)
+ if ( XML_Parse(parser, text, first_chunk_bytes, XML_FALSE)
+ == XML_STATUS_ERROR)
xml_failure(parser);
else {
enum XML_Status rc;
rc = XML_Parse(parser, text + first_chunk_bytes,
- sizeof(text) - first_chunk_bytes - 1, 1);
+ sizeof(text) - first_chunk_bytes - 1, XML_TRUE);
if (rc == XML_STATUS_ERROR)
xml_failure(parser);
}
@@ -388,7 +389,7 @@
"\n";
int lineno;
- if (XML_Parse(parser, text, strlen(text), 0) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
lineno = XML_GetCurrentLineNumber(parser);
if (lineno != 4) {
@@ -405,7 +406,7 @@
char *text = " ";
int colno;
- if (XML_Parse(parser, text, strlen(text), 0) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
colno = XML_GetCurrentColumnNumber(parser);
if (colno != 11) {
@@ -470,7 +471,7 @@
XML_SetUserData(parser, &storage);
XML_SetStartElementHandler(parser, start_element_event_handler2);
XML_SetEndElementHandler(parser, end_element_event_handler2);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckString(&storage, expected);
@@ -485,7 +486,7 @@
" \n"
" "; /* missing */
int lineno;
- if (XML_Parse(parser, text, strlen(text), 0) != XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
lineno = XML_GetCurrentLineNumber(parser);
@@ -505,7 +506,7 @@
" \n"
" "; /* missing */
int colno;
- if (XML_Parse(parser, text, strlen(text), 0) != XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR)
fail("Expected a parse error");
colno = XML_GetCurrentColumnNumber(parser);
@@ -547,7 +548,7 @@
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+"
"";
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -574,7 +575,7 @@
CharData_Init(&storage);
XML_SetUserData(parser, &storage);
XML_SetEndElementHandler(parser, end_element_event_handler);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckString(&storage, expected);
}
@@ -687,7 +688,7 @@
XML_SetStartElementHandler(parser,
check_attr_contains_normalized_whitespace);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -731,7 +732,7 @@
" ";
XML_SetUnknownEncodingHandler(parser, UnknownEncodingHandler, NULL);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -757,7 +758,8 @@
fail("Could not create external entity parser.");
if (!XML_SetEncoding(extparser, "utf-8"))
fail("XML_SetEncoding() ignored for external entity");
- if (XML_Parse(extparser, text, strlen(text), 1) == XML_STATUS_ERROR) {
+ if ( XML_Parse(extparser, text, strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
xml_failure(parser);
return 0;
}
@@ -786,7 +788,7 @@
"\n"
"&entity; ";
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -829,7 +831,8 @@
extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
if (extparser == NULL)
fail("Could not create external entity parser.");
- if (XML_Parse(extparser, text, strlen(text), 1) == XML_STATUS_ERROR) {
+ if ( XML_Parse(extparser, text, strlen(text), XML_TRUE)
+ == XML_STATUS_ERROR) {
xml_failure(parser);
return XML_STATUS_ERROR;
}
@@ -870,7 +873,7 @@
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetUserData(parser, foo_text);
XML_SetExternalEntityRefHandler(parser, external_entity_loader);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -929,7 +932,7 @@
" \n"
"";
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -998,10 +1001,10 @@
"http://expat.sf.net/ e foo",
"http://expat.sf.net/ a bar"
};
- XML_SetReturnNSTriplet(parser, 1);
+ XML_SetReturnNSTriplet(parser, XML_TRUE);
XML_SetUserData(parser, elemstr);
XML_SetElementHandler(parser, triplet_start_checker, triplet_end_checker);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1038,7 +1041,7 @@
XML_SetUserData(parser, &storage);
XML_SetElementHandler(parser,
overwrite_start_checker, overwrite_end_checker);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
CharData_CheckString(&storage, result);
}
@@ -1081,7 +1084,7 @@
"attribute http://xml.libexpat.org/ attr2 n\n"
"end http://xml.libexpat.org/ g n\n"
"end http://xml.libexpat.org/ e n\n";
- XML_SetReturnNSTriplet(parser, 1);
+ XML_SetReturnNSTriplet(parser, XML_TRUE);
run_ns_tagname_overwrite_test(text, result);
}
END_TEST
@@ -1115,7 +1118,7 @@
XML_SetStartElementHandler(parser, start_element_fail);
XML_SetStartNamespaceDeclHandler(parser, start_ns_clearing_start_element);
XML_UseParserAsHandlerArg(parser);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1142,7 +1145,7 @@
XML_SetUserData(parser, (void *) callno);
p2 = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (XML_Parse(p2, text, strlen(text), 1) == XML_STATUS_ERROR) {
+ if (XML_Parse(p2, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR) {
xml_failure(p2);
return 0;
}
@@ -1166,7 +1169,7 @@
/* We actually need to set this handler to tickle this bug. */
XML_SetStartElementHandler(parser, dummy_start_element);
XML_SetUserData(parser, NULL);
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1199,13 +1202,54 @@
}
END_TEST
+/* Regression test #3 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_3)
+{
+ char *text =
+ "\n"
+ " \n"
+ "]>\n"
+ " ";
+
+ expect_failure(text,
+ XML_ERROR_SYNTAX,
+ "Didn't report attr default setting NS w/ prefix to ''.");
+}
+END_TEST
+
+/* Regression test #4 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_4)
+{
+ char *text =
+ "\n"
+ " \n"
+ "]>\n"
+ " ";
+ /* Packaged info expected by the end element handler;
+ the weird structuring lets us re-use the triplet_end_checker()
+ function also used for another test. */
+ char *elemstr[] = {
+ "http://xml.libexpat.org/ doc prefix"
+ };
+ XML_SetReturnNSTriplet(parser, XML_TRUE);
+ XML_SetUserData(parser, elemstr);
+ XML_SetEndElementHandler(parser, triplet_end_checker);
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+ xml_failure(parser);
+}
+END_TEST
+
START_TEST(test_ns_default_with_empty_uri)
{
char *text =
"\n"
" \n"
" ";
- if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
+ if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
}
END_TEST
@@ -1268,6 +1312,8 @@
tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_3);
+ tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_4);
tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
return s;
From fdrake at users.sourceforge.net Mon Jan 27 21:45:15 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 00:45:18 2003
Subject: [Expat-checkins] expat/lib xmlparse.c,1.106,1.107
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv23378
Modified Files:
xmlparse.c
Log Message:
Karl's latest patch for SF issue #673791:
Call storeAtts() for all element start tags; this is necessary to
ensure attribute defaults are properly processed for all elements
(needed to do proper namespace checking, at the very least), and that
tag names are properly cooked when there's an end-element-handler but
no start-element-handler.
This causes the new tests to pass, and closes the SF tracker issue.
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- xmlparse.c 25 Jan 2003 06:53:05 -0000 1.106
+++ xmlparse.c 28 Jan 2003 05:45:10 -0000 1.107
@@ -316,8 +316,8 @@
#endif /* XML_DTD */
static enum XML_Error
-storeAtts(XML_Parser parser, const ENCODING *,
- const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
+storeAtts(XML_Parser parser, const ENCODING *, const char *s,
+ TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr);
@@ -2104,11 +2104,6 @@
}
tag->name.str = (XML_Char *)tag->buf;
*toPtr = XML_T('\0');
- if (!startElementHandler && (tok == XML_TOK_START_TAG_NO_ATTS)) {
- if (defaultHandler)
- reportDefault(parser, enc, s, next);
- break;
- }
result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
if (result)
return result;
@@ -2121,13 +2116,6 @@
break;
}
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
- if (!startElementHandler && !endElementHandler) {
- if (defaultHandler)
- reportDefault(parser, enc, s, next);
- if (tagLevel == 0)
- return epilogProcessor(parser, next, end, nextPtr);
- break;
- }
/* fall through */
case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
{
@@ -2141,13 +2129,10 @@
if (!name.str)
return XML_ERROR_NO_MEMORY;
poolFinish(&tempPool);
- if (startElementHandler ||
- (tok == XML_TOK_EMPTY_ELEMENT_WITH_ATTS)) {
- result = storeAtts(parser, enc, s, &name, &bindings);
- if (result)
- return result;
- poolFinish(&tempPool);
- }
+ result = storeAtts(parser, enc, s, &name, &bindings);
+ if (result)
+ return result;
+ poolFinish(&tempPool);
if (startElementHandler) {
startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
noElmHandlers = XML_FALSE;
@@ -2350,8 +2335,15 @@
/* not reached */
}
-/* If tagNamePtr is non-null, build a real list of attributes,
- otherwise just check the attributes for well-formedness.
+/* Precondition: all arguments must be non-NULL;
+ Purpose:
+ - normalize attributes
+ - check attributes for well-formedness
+ - generate namespace aware attribute names (URI, prefix)
+ - build list of attributes for startElementHandler
+ - default attributes
+ - process namespace declarations (check and report them)
+ - generate namespace aware element name (URI, prefix)
*/
static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *enc,
@@ -2372,21 +2364,20 @@
const XML_Char *localPart;
/* lookup the element type name */
- if (tagNamePtr) {
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
- if (!elementType) {
- const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
- if (!name)
- return XML_ERROR_NO_MEMORY;
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
- sizeof(ELEMENT_TYPE));
- if (!elementType)
- return XML_ERROR_NO_MEMORY;
- if (ns && !setElementTypePrefix(parser, elementType))
- return XML_ERROR_NO_MEMORY;
- }
- nDefaultAtts = elementType->nDefaultAtts;
+ elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
+ if (!elementType) {
+ const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
+ if (!name)
+ return XML_ERROR_NO_MEMORY;
+ elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
+ sizeof(ELEMENT_TYPE));
+ if (!elementType)
+ return XML_ERROR_NO_MEMORY;
+ if (ns && !setElementTypePrefix(parser, elementType))
+ return XML_ERROR_NO_MEMORY;
}
+ nDefaultAtts = elementType->nDefaultAtts;
+
/* get the attributes from the tokenizer */
n = XmlGetAttributes(enc, attStr, attsSize, atts);
if (n + nDefaultAtts > attsSize) {
@@ -2400,6 +2391,7 @@
if (n > oldAttsSize)
XmlGetAttributes(enc, attStr, n, atts);
}
+
appAtts = (const XML_Char **)atts;
for (i = 0; i < n; i++) {
/* add the name and value to the attribute list */
@@ -2437,14 +2429,10 @@
&tempPool);
if (result)
return result;
- if (tagNamePtr) {
- appAtts[attIndex] = poolStart(&tempPool);
- poolFinish(&tempPool);
- }
- else
- poolDiscard(&tempPool);
+ appAtts[attIndex] = poolStart(&tempPool);
+ poolFinish(&tempPool);
}
- else if (tagNamePtr) {
+ else {
/* the value did not need normalizing */
appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr,
atts[i].valueEnd);
@@ -2453,7 +2441,7 @@
poolFinish(&tempPool);
}
/* handle prefixed attribute names */
- if (attId->prefix && tagNamePtr) {
+ if (attId->prefix) {
if (attId->xmlns) {
/* deal with namespace declarations here */
enum XML_Error result = addBinding(parser, attId->prefix, attId,
@@ -2472,45 +2460,46 @@
else
attIndex++;
}
- if (tagNamePtr) {
- int j;
- nSpecifiedAtts = attIndex;
- if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
- for (i = 0; i < attIndex; i += 2)
- if (appAtts[i] == elementType->idAtt->name) {
- idAttIndex = i;
- break;
- }
- }
- else
- idAttIndex = -1;
- /* do attribute defaulting */
- for (j = 0; j < nDefaultAtts; j++) {
- const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + j;
- if (!(da->id->name)[-1] && da->value) {
- if (da->id->prefix) {
- if (da->id->xmlns) {
- enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
- da->value, bindingsPtr);
- if (result)
- return result;
- }
- else {
- (da->id->name)[-1] = 2;
- nPrefixes++;
- appAtts[attIndex++] = da->id->name;
- appAtts[attIndex++] = da->value;
- }
+
+ /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
+ nSpecifiedAtts = attIndex;
+ if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
+ for (i = 0; i < attIndex; i += 2)
+ if (appAtts[i] == elementType->idAtt->name) {
+ idAttIndex = i;
+ break;
+ }
+ }
+ else
+ idAttIndex = -1;
+
+ /* do attribute defaulting */
+ for (i = 0; i < nDefaultAtts; i++) {
+ const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i;
+ if (!(da->id->name)[-1] && da->value) {
+ if (da->id->prefix) {
+ if (da->id->xmlns) {
+ enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
+ da->value, bindingsPtr);
+ if (result)
+ return result;
}
else {
- (da->id->name)[-1] = 1;
+ (da->id->name)[-1] = 2;
+ nPrefixes++;
appAtts[attIndex++] = da->id->name;
appAtts[attIndex++] = da->value;
}
}
+ else {
+ (da->id->name)[-1] = 1;
+ appAtts[attIndex++] = da->id->name;
+ appAtts[attIndex++] = da->value;
+ }
}
- appAtts[attIndex] = 0;
}
+ appAtts[attIndex] = 0;
+
i = 0;
if (nPrefixes) {
/* expand prefixed attribute names */
@@ -2555,10 +2544,9 @@
/* clear the flags that say whether attributes were specified */
for (; i < attIndex; i += 2)
((XML_Char *)(appAtts[i]))[-1] = 0;
- if (!tagNamePtr)
- return XML_ERROR_NONE;
for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding)
binding->attId->name[-1] = 0;
+
/* expand the element type name */
if (elementType->prefix) {
binding = elementType->prefix->binding;
From fdrake at users.sourceforge.net Mon Jan 27 21:54:10 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 00:54:14 2003
Subject: [Expat-checkins] expat Changes,1.33,1.34
Message-ID:
Update of /cvsroot/expat/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv1313
Modified Files:
Changes
Log Message:
Fix the release date... again.
Index: Changes
===================================================================
RCS file: /cvsroot/expat/expat/Changes,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- Changes 25 Jan 2003 15:33:21 -0000 1.33
+++ Changes 28 Jan 2003 05:54:08 -0000 1.34
@@ -1,4 +1,4 @@
-Release 1.95.6 Sat Jan 25 2003
+Release 1.95.6 Tue Jan 28 2003
- Added XML_FreeContentModel().
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
- Fixed a variety of bugs: see SF issues 615606, 616863,
From fdrake at users.sourceforge.net Mon Jan 27 21:54:35 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 00:54:38 2003
Subject: [Expat-checkins] htdocs index.html,1.37,1.38
Message-ID:
Update of /cvsroot/expat/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv1800
Modified Files:
index.html
Log Message:
Fix the release date... again.
Index: index.html
===================================================================
RCS file: /cvsroot/expat/htdocs/index.html,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- index.html 25 Jan 2003 18:43:29 -0000 1.37
+++ index.html 28 Jan 2003 05:54:33 -0000 1.38
@@ -52,7 +52,7 @@
News
- 25 January 2003 ,
+ 28 January 2003 ,
Expat 1.95.6 released.
From fdrake at users.sourceforge.net Tue Jan 28 07:23:43 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 10:23:49 2003
Subject: [Expat-checkins] expat/doc reference.html,1.41,1.42
Message-ID:
Update of /cvsroot/expat/expat/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv19756
Modified Files:
reference.html
Log Message:
XML_Status is an enum, not a typedef name.
Index: reference.html
===================================================================
RCS file: /cvsroot/expat/expat/doc/reference.html,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- reference.html 21 Jan 2003 16:09:31 -0000 1.41
+++ reference.html 28 Jan 2003 15:23:39 -0000 1.42
@@ -719,7 +719,7 @@
>XML_ExternalEntityParserCreate.
-XML_Status
+enum XML_Status
XML_Parse(XML_Parser p,
const char *s,
int len,
@@ -746,7 +746,7 @@
-XML_Status
+enum XML_Status
XML_ParseBuffer(XML_Parser p,
int len,
int isFinal);
From fdrake at users.sourceforge.net Tue Jan 28 07:27:06 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 10:27:10 2003
Subject: [Expat-checkins] expat/win32 expat.iss,1.15,1.16
Message-ID:
Update of /cvsroot/expat/expat/win32
In directory sc8-pr-cvs1:/tmp/cvs-serv21305
Modified Files:
expat.iss
Log Message:
Add win32/README.txt to the Source/ directory that gets installed.
Index: expat.iss
===================================================================
RCS file: /cvsroot/expat/expat/win32/expat.iss,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- expat.iss 26 Jan 2003 01:11:29 -0000 1.15
+++ expat.iss 28 Jan 2003 15:26:59 -0000 1.16
@@ -42,6 +42,7 @@
CopyMode: alwaysoverwrite; Source: lib\Release_static\*.lib; DestDir: "{app}\StaticLibs"
CopyMode: alwaysoverwrite; Source: lib\Release-w_static\*.lib; DestDir: "{app}\StaticLibs"
CopyMode: alwaysoverwrite; Source: expat.dsw; DestDir: "{app}\Source"
+CopyMode: alwaysoverwrite; Source: win32\README.txt; DestDir: "{app}\Source"
CopyMode: alwaysoverwrite; Source: bcb5\*.*; DestDir: "{app}\Source\bcb5"
CopyMode: alwaysoverwrite; Source: lib\*.c; DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: lib\*.h; DestDir: "{app}\Source\lib"
From fdrake at users.sourceforge.net Tue Jan 28 18:43:11 2003
From: fdrake at users.sourceforge.net (Fred L. Drake)
Date: Tue Jan 28 21:43:13 2003
Subject: [Expat-checkins] expat/lib expat.h,1.50,1.51
Message-ID:
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv30360
Modified Files:
expat.h
Log Message:
Move the XML_Status enum definition earlier. Some recent versions of
GCC (3.2 at least) report an error from the forward reference.
Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- expat.h 16 Jan 2003 22:03:42 -0000 1.50
+++ expat.h 29 Jan 2003 02:43:08 -0000 1.51
@@ -57,6 +57,26 @@
#define XML_TRUE ((XML_Bool) 1)
#define XML_FALSE ((XML_Bool) 0)
+/* The XML_Status enum gives the possible return values for several
+ API functions. The preprocessor #defines are included so this
+ stanza can be added to code that still needs to support older
+ versions of Expat 1.95.x:
+
+ #ifndef XML_STATUS_OK
+ #define XML_STATUS_OK 1
+ #define XML_STATUS_ERROR 0
+ #endif
+
+ Otherwise, the #define hackery is quite ugly and would have been
+ dropped.
+*/
+enum XML_Status {
+ XML_STATUS_ERROR = 0,
+#define XML_STATUS_ERROR XML_STATUS_ERROR
+ XML_STATUS_OK = 1
+#define XML_STATUS_OK XML_STATUS_OK
+};
+
enum XML_Error {
XML_ERROR_NONE,
XML_ERROR_NO_MEMORY,
@@ -717,28 +737,11 @@
detected. The last call to XML_Parse must have isFinal true; len
may be zero for this call (or any other).
- The XML_Status enum gives the possible return values for the
- XML_Parse and XML_ParseBuffer functions. Though the return values
- for these functions has always been described as a Boolean value,
- the implementation, at least for the 1.95.x series, has always
- returned exactly one of these values. The preprocessor #defines
- are included so this stanza can be added to code that still needs
- to support older versions of Expat 1.95.x:
-
- #ifndef XML_STATUS_OK
- #define XML_STATUS_OK 1
- #define XML_STATUS_ERROR 0
- #endif
-
- Otherwise, the #define hackery is quite ugly and would have been dropped.
+ Though the return values for these functions has always been
+ described as a Boolean value, the implementation, at least for the
+ 1.95.x series, has always returned exactly one of the XML_Status
+ values.
*/
-enum XML_Status {
- XML_STATUS_ERROR = 0,
-#define XML_STATUS_ERROR XML_STATUS_ERROR
- XML_STATUS_OK = 1
-#define XML_STATUS_OK XML_STATUS_OK
-};
-
XMLPARSEAPI(enum XML_Status)
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);