? win32/dsp/xmllint ? win32/dsp/libxml2_a ? win32/dsp/libxml2_new ? win32/dsp/libxml2_so ? win32/dsp/xmlcatalog Index: config.h.in =================================================================== RCS file: /cvs/gnome/gnome-xml/config.h.in,v retrieving revision 1.29 diff -c -r1.29 config.h.in *** config.h.in 2001/12/18 07:53:15 1.29 --- config.h.in 2002/01/12 23:41:59 *************** *** 1,5 **** --- 1,8 ---- /* config.h.in. Generated automatically from configure.in by autoheader. */ + /* Define if you have the strftime function. */ + #undef HAVE_STRFTIME + /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS *************** *** 89,97 **** /* Define if you have the header file. */ #undef HAVE_DIRENT_H - - /* Define if you have the header file. */ - #undef HAVE_DLFCN_H /* Define if you have the header file. */ #undef HAVE_ERRNO_H --- 92,97 ---- Index: entities.c =================================================================== RCS file: /cvs/gnome/gnome-xml/entities.c,v retrieving revision 1.56 diff -c -r1.56 entities.c *** entities.c 2002/01/09 11:51:36 1.56 --- entities.c 2002/01/12 23:42:46 *************** *** 991,993 **** --- 991,1025 ---- xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) { xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDecl, buf); } + + + static xmlEntityReferenceFunc xmlEntityRefFunc = NULL; + + /** + * xmlAddEntityReference: + * @ent : A valid entity + * @firstNode : A valid first node for children of entity + * @lastNode : A valid last node of children entity + * + * Notify of a reference to an entity of type XML_EXTERNAL_GENERAL_PARSED_ENTITY + */ + void xmlAddEntityReference(xmlEntityPtr ent, xmlNodePtr firstNode, + xmlNodePtr lastNode) + { + if (xmlEntityRefFunc != NULL){ + (*xmlEntityRefFunc)(ent, firstNode, lastNode); + } + } + + + /** + * xmlSetEntityReferenceFunc: + * @func : A valid function + * + * Set the function to call call back when a xml reference has been made + */ + void xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func) + { + xmlEntityRefFunc = func; + } + Index: parser.c =================================================================== RCS file: /cvs/gnome/gnome-xml/parser.c,v retrieving revision 1.185 diff -c -r1.185 parser.c *** parser.c 2002/01/08 10:36:12 1.185 --- parser.c 2002/01/12 23:44:48 *************** *** 527,534 **** } else { ctxt->errNo = XML_ERR_INVALID_CHAR; if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ! ctxt->sax->error(ctxt->userData, ! "xmlParseCharRef: invalid xmlChar value %d\n", val); ctxt->wellFormed = 0; ctxt->disableSAX = 1; --- 527,534 ---- } else { ctxt->errNo = XML_ERR_INVALID_CHAR; if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ! ctxt->sax->error(ctxt->userData, ! "xmlParseCharRef: invalid xmlChar value %d\n", val); ctxt->wellFormed = 0; ctxt->disableSAX = 1; *************** *** 2955,2961 **** if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) { ctxt->errNo = XML_ERR_RESERVED_XML_NAME; ctxt->sax->warning(ctxt->userData, ! "xmlParsePITarget: invalid name prefix 'xml'\n"); } } return(name); --- 2955,2961 ---- if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) { ctxt->errNo = XML_ERR_RESERVED_XML_NAME; ctxt->sax->warning(ctxt->userData, ! "xmlParsePItarget: invalid name prefix 'xml'\n"); } } return(name); *************** *** 5254,5261 **** if (list->next == NULL) ent->last = list; list = list->next; ! } list = ent->children; } } else { while (list != NULL) { --- 5254,5263 ---- if (list->next == NULL) ent->last = list; list = list->next; ! } list = ent->children; + if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) + xmlAddEntityReference(ent, list, NULL); } } else { while (list != NULL) { *************** *** 5297,5311 **** * In the first occurrence list contains the replacement */ if (list == NULL) { ! xmlNodePtr new, cur; cur = ent->children; while (cur != NULL) { new = xmlCopyNode(cur, 1); xmlAddChild(ctxt->node, new); if (cur == ent->last) break; cur = cur->next; } } else { /* * the name change is to avoid coalescing of the --- 5299,5318 ---- * In the first occurrence list contains the replacement */ if (list == NULL) { ! xmlNodePtr new = NULL, cur, firstChild = NULL; cur = ent->children; while (cur != NULL) { new = xmlCopyNode(cur, 1); + if (firstChild == NULL){ + firstChild = new; + } xmlAddChild(ctxt->node, new); if (cur == ent->last) break; cur = cur->next; } + if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) + xmlAddEntityReference(ent, firstChild, new); } else { /* * the name change is to avoid coalescing of the Index: tree.c =================================================================== RCS file: /cvs/gnome/gnome-xml/tree.c,v retrieving revision 1.174 diff -c -r1.174 tree.c *** tree.c 2002/01/06 23:05:13 1.174 --- tree.c 2002/01/12 23:47:00 *************** *** 2642,2650 **** ret->parent = target; if ((cur->ns != NULL) && (target != NULL)) { ! xmlNsPtr ns; ! ns = xmlSearchNs(target->doc, target, cur->ns->prefix); ret->ns = ns; } else ret->ns = NULL; --- 2642,2654 ---- ret->parent = target; if ((cur->ns != NULL) && (target != NULL)) { ! xmlNsPtr ns; ! if (target->doc) ns = xmlSearchNs(target->doc, target, cur->ns->prefix); + else if (cur->doc) /* target may not yet have a doc : KPI */ + ns = xmlSearchNs(cur->doc, target, cur->ns->prefix); + else + ns = NULL; ret->ns = ns; } else ret->ns = NULL; *************** *** 2786,2791 **** --- 2790,2798 ---- xmlBufferContent(node->content), xmlBufferLength(node->content)); #endif + }else{ + if (node->type == XML_ELEMENT_NODE) + ret->content = (void*)(long) node->content; } if (parent != NULL) xmlAddChild(parent, ret); Index: include/libxml/entities.h =================================================================== RCS file: /cvs/gnome/gnome-xml/include/libxml/entities.h,v retrieving revision 1.31 diff -c -r1.31 entities.h *** include/libxml/entities.h 2001/12/31 16:16:02 1.31 --- include/libxml/entities.h 2002/01/12 23:50:27 *************** *** 103,108 **** --- 103,117 ---- xmlEntityPtr ent); void xmlCleanupPredefinedEntities(void); + typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, + xmlNodePtr firstNode, + xmlNodePtr lastNode); + + void xmlAddEntityReference(xmlEntityPtr ent, + xmlNodePtr firstNode, + xmlNodePtr lastNode); + void xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func); + #ifdef __cplusplus }