? backup ? win32/dsp/xmllint ? win32/dsp/libxml2_a ? win32/dsp/libxml2_new ? win32/dsp/libxml2_so ? win32/dsp/xmlcatalog Index: entities.c =================================================================== RCS file: /cvs/gnome/gnome-xml/entities.c,v retrieving revision 1.55 diff -c -r1.55 entities.c *** entities.c 2001/12/31 16:15:57 1.55 --- entities.c 2002/01/07 17:15:27 *************** *** 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.183 diff -c -r1.183 parser.c *** parser.c 2002/01/06 12:47:22 1.183 --- parser.c 2002/01/07 17:15:47 *************** *** 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,533 ---- } 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; *************** *** 1522,1528 **** } /* ! * Forward definition for recursive behavior. */ void xmlParsePEReference(xmlParserCtxtPtr ctxt); void xmlParseReference(xmlParserCtxtPtr ctxt); --- 1521,1527 ---- } /* ! * Forward definition for recursive behaviour. */ void xmlParsePEReference(xmlParserCtxtPtr ctxt); void xmlParseReference(xmlParserCtxtPtr ctxt); *************** *** 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); --- 2954,2960 ---- 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); *************** *** 5252,5259 **** if (list->next == NULL) ent->last = list; list = list->next; ! } list = ent->children; } } else { while (list != NULL) { --- 5251,5259 ---- if (list->next == NULL) ent->last = list; list = list->next; ! } list = ent->children; + xmlAddEntityReference(ent, list, list->last); } } else { while (list != NULL) { *************** *** 5295,5309 **** * 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 --- 5295,5312 ---- * 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; } + 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/07 17:15:58 *************** *** 2383,2389 **** * * The xmlStrEqual comparisons need to be done when (happened with * XML::libXML and XML::libXSLT) the library is included twice ! * statically in the binary and a tree allocated by one occurrence * of the lib gets freed by the other occurrence, in this case * the string addresses compare are not sufficient. */ --- 2383,2389 ---- * * The xmlStrEqual comparisons need to be done when (happened with * XML::libXML and XML::libXSLT) the library is included twice ! * statically in the binary and a tree allocated by one occurence * of the lib gets freed by the other occurrence, in this case * the string addresses compare are not sufficient. */ *************** *** 2786,2791 **** --- 2786,2794 ---- 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/07 17:15:59 *************** *** 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 }