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.
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.
- 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
- _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
Karl Waclawek [Wed, 22 Jan 2003 14:52:20 +0000 (14:52 +0000)]
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.
Karl Waclawek [Thu, 16 Jan 2003 22:03:42 +0000 (22:03 +0000)]
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
Moving the Borland module definition files to the bcb5 dir, correcting
an error in the LIBRARY entry in the def files, calling the new def
files in the proj and make files.
Revision of Borland proj and make files to fix dos carriage return
problem. Files remain identical to initial release for building static
and wide-char versions of libs, as well as the dll's.
Karl Waclawek [Mon, 21 Oct 2002 21:19:41 +0000 (21:19 +0000)]
* Applied patch #620822 - Windows Dll build with DEF file
* Changed macro for static linking from _STATIC to XML_STATIC
and modified expat.h accordingly
* Added ReadMe file to Win32 subdirectory documenting Windows builds
* Changed static build settings to create libraries with names different
from the Dll stub library libexpat(w).lib
SF bug #620343: segfault: bad API/callback interaction
The start-namespace-decl callback can set the start-element callback to
NULL, but Expat tried to call it anyway.
A last-minute report suggests a problem with this using at least some
versions of egcs, so disable FASTCALL for GCC as well. We are now not using
this for any platform. ;-(
Disable FASTCALL on Windows since it turned out not to be as effective
as hoped. Leaving the definition in the file so we'll know what it
was that didn't work, and hopefully find something better in the
future.