Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24129/runtime
Modified Files:
Tag: XQuery_0-18
shredder.mx
Log Message:
- Solve problem where a DTD comment appeared in the document
(entities_dtd.SF-1642665.dtd). The parser maintains a variable
inSubset which indicates it is parsing a DTD. When true no comment
is added to Pathfinder.
(Maybe we should do the same for processing instructions?)
- Small fix in external subset DTD handling.
Index: shredder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/shredder.mx,v
retrieving revision 1.126.2.4
retrieving revision 1.126.2.5
diff -u -d -r1.126.2.4 -r1.126.2.5
--- shredder.mx 6 Jun 2007 15:44:40 -0000 1.126.2.4
+++ shredder.mx 7 Jun 2007 07:50:13 -0000 1.126.2.5
@@ -1065,8 +1065,13 @@
const xmlChar *c)
{
shredCtxStruct *shredCtx = (shredCtxStruct*) xmlCtx;
+ xmlParserCtxtPtr pctx = ((shredCtxStruct*) xmlCtx)->xmlCtx;
node_t node;
+ if ( pctx->inSubset ) {
+ /* handle a libxml2 peculiarity, comments in DTD are added to the doc
*/
+ return;
+ }
if (!handle_xml_chars(shredCtx)) {
BAILOUT(shredCtx);
}
@@ -1198,8 +1203,13 @@
* subset for this doc
*/
ctx->myDoc = xmlNewDoc(ctx->version);
- ctx->myDoc->extSubset = dtd;
}
+ if ( !ctx->myDoc->extSubset ) {
+ ctx->myDoc->extSubset = dtd;
+ } else {
+ stream_printf(GDKout, "!WARNING: double external
subset(\"%s\") may cause problems.\n", SystemID);
+ xmlFreeDtd(dtd);
+ }
if (!handle_externalSubset(shredCtx, dtd))
stream_printf(GDKout, "!WARNING: xmlParseDTD(\"%s\") failed,
skipping ID/IDREF information.\n", SystemID);
// xmlFreeDtd(dtd); should be done by freeer of myDoc
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins