version 1.82, 2000/10/15 14:20:58
|
version 1.83, 2000/10/25 19:26:52
|
Line 161 internalSubset(void *ctx, const xmlChar
|
Line 161 internalSubset(void *ctx, const xmlChar
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlDtdPtr dtd; |
xmlDtdPtr dtd; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.internalSubset(%s, %s, %s)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.internalSubset(%s, %s, %s)\n", |
name, ExternalID, SystemID); |
name, ExternalID, SystemID); |
#endif |
#endif |
|
|
Line 194 externalSubset(void *ctx, const xmlChar
|
Line 195 externalSubset(void *ctx, const xmlChar
|
{ |
{ |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.externalSubset(%s, %s, %s)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.externalSubset(%s, %s, %s)\n", |
name, ExternalID, SystemID); |
name, ExternalID, SystemID); |
#endif |
#endif |
if (((ExternalID != NULL) || (SystemID != NULL)) && |
if (((ExternalID != NULL) || (SystemID != NULL)) && |
Line 323 resolveEntity(void *ctx, const xmlChar *
|
Line 325 resolveEntity(void *ctx, const xmlChar *
|
URI = xmlBuildURI(systemId, (const xmlChar *) base); |
URI = xmlBuildURI(systemId, (const xmlChar *) base); |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.resolveEntity(%s, %s)\n", publicId, systemId); |
#endif |
#endif |
|
|
ret = xmlLoadExternalEntity((const char *) URI, |
ret = xmlLoadExternalEntity((const char *) URI, |
Line 349 getEntity(void *ctx, const xmlChar *name
|
Line 352 getEntity(void *ctx, const xmlChar *name
|
xmlEntityPtr ret; |
xmlEntityPtr ret; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.getEntity(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.getEntity(%s)\n", name); |
#endif |
#endif |
|
|
ret = xmlGetDocEntity(ctxt->myDoc, name); |
ret = xmlGetDocEntity(ctxt->myDoc, name); |
Line 385 getParameterEntity(void *ctx, const xmlC
|
Line 389 getParameterEntity(void *ctx, const xmlC
|
xmlEntityPtr ret; |
xmlEntityPtr ret; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.getParameterEntity(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.getParameterEntity(%s)\n", name); |
#endif |
#endif |
|
|
ret = xmlGetParameterEntity(ctxt->myDoc, name); |
ret = xmlGetParameterEntity(ctxt->myDoc, name); |
Line 412 entityDecl(void *ctx, const xmlChar *nam
|
Line 417 entityDecl(void *ctx, const xmlChar *nam
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.entityDecl(%s, %d, %s, %s, %s)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.entityDecl(%s, %d, %s, %s, %s)\n", |
name, type, publicId, systemId, content); |
name, type, publicId, systemId, content); |
#endif |
#endif |
if (ctxt->inSubset == 1) { |
if (ctxt->inSubset == 1) { |
Line 482 attributeDecl(void *ctx, const xmlChar *
|
Line 488 attributeDecl(void *ctx, const xmlChar *
|
xmlChar *name = NULL, *prefix = NULL; |
xmlChar *name = NULL, *prefix = NULL; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n", |
elem, fullname, type, def, defaultValue); |
elem, fullname, type, def, defaultValue); |
#endif |
#endif |
name = xmlSplitQName(ctxt, fullname, &prefix); |
name = xmlSplitQName(ctxt, fullname, &prefix); |
Line 528 elementDecl(void *ctx, const xmlChar *na
|
Line 535 elementDecl(void *ctx, const xmlChar *na
|
xmlElementPtr elem = NULL; |
xmlElementPtr elem = NULL; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.elementDecl(%s, %d, ...)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.elementDecl(%s, %d, ...)\n", |
fullname, type); |
fullname, type); |
#endif |
#endif |
|
|
Line 567 notationDecl(void *ctx, const xmlChar *n
|
Line 575 notationDecl(void *ctx, const xmlChar *n
|
xmlNotationPtr nota = NULL; |
xmlNotationPtr nota = NULL; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.notationDecl(%s, %s, %s)\n", name, publicId, systemId); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.notationDecl(%s, %s, %s)\n", name, publicId, systemId); |
#endif |
#endif |
|
|
if (ctxt->inSubset == 1) |
if (ctxt->inSubset == 1) |
Line 606 unparsedEntityDecl(void *ctx, const xmlC
|
Line 615 unparsedEntityDecl(void *ctx, const xmlC
|
{ |
{ |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n", |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.unparsedEntityDecl(%s, %s, %s, %s)\n", |
name, publicId, systemId, notationName); |
name, publicId, systemId, notationName); |
#endif |
#endif |
if (ctxt->validate && ctxt->wellFormed && |
if (ctxt->validate && ctxt->wellFormed && |
Line 631 setDocumentLocator(void *ctx, xmlSAXLoca
|
Line 641 setDocumentLocator(void *ctx, xmlSAXLoca
|
{ |
{ |
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ |
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.setDocumentLocator()\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.setDocumentLocator()\n"); |
#endif |
#endif |
} |
} |
|
|
Line 648 startDocument(void *ctx)
|
Line 659 startDocument(void *ctx)
|
xmlDocPtr doc; |
xmlDocPtr doc; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.startDocument()\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.startDocument()\n"); |
#endif |
#endif |
if (ctxt->html) { |
if (ctxt->html) { |
if (ctxt->myDoc == NULL) |
if (ctxt->myDoc == NULL) |
#ifdef LIBXML_HTML_ENABLED |
#ifdef LIBXML_HTML_ENABLED |
ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); |
ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); |
#else |
#else |
fprintf(stderr, "libxml2 built without HTML support\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"libxml2 built without HTML support\n"); |
#endif |
#endif |
} else { |
} else { |
doc = ctxt->myDoc = xmlNewDoc(ctxt->version); |
doc = ctxt->myDoc = xmlNewDoc(ctxt->version); |
Line 684 endDocument(void *ctx)
|
Line 697 endDocument(void *ctx)
|
{ |
{ |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.endDocument()\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.endDocument()\n"); |
#endif |
#endif |
if (ctxt->validate && ctxt->wellFormed && |
if (ctxt->validate && ctxt->wellFormed && |
ctxt->myDoc && ctxt->myDoc->intSubset) |
ctxt->myDoc && ctxt->myDoc->intSubset) |
Line 731 attribute(void *ctx, const xmlChar *full
|
Line 745 attribute(void *ctx, const xmlChar *full
|
|
|
/**************** |
/**************** |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.attribute(%s, %s)\n", fullname, value); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.attribute(%s, %s)\n", fullname, value); |
#endif |
#endif |
****************/ |
****************/ |
/* |
/* |
Line 897 startElement(void *ctx, const xmlChar *f
|
Line 912 startElement(void *ctx, const xmlChar *f
|
int i; |
int i; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.startElement(%s)\n", fullname); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.startElement(%s)\n", fullname); |
#endif |
#endif |
|
|
/* |
/* |
Line 932 startElement(void *ctx, const xmlChar *f
|
Line 948 startElement(void *ctx, const xmlChar *f
|
if (ret == NULL) return; |
if (ret == NULL) return; |
if (ctxt->myDoc->children == NULL) { |
if (ctxt->myDoc->children == NULL) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "Setting %s as root\n", name); |
xmlGenericError(xmlGenericErrorContext, "Setting %s as root\n", name); |
#endif |
#endif |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
} else if (parent == NULL) { |
} else if (parent == NULL) { |
Line 944 startElement(void *ctx, const xmlChar *f
|
Line 960 startElement(void *ctx, const xmlChar *f
|
* We are parsing a new node. |
* We are parsing a new node. |
*/ |
*/ |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "pushing(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, "pushing(%s)\n", name); |
#endif |
#endif |
nodePush(ctxt, ret); |
nodePush(ctxt, ret); |
|
|
Line 954 startElement(void *ctx, const xmlChar *f
|
Line 970 startElement(void *ctx, const xmlChar *f
|
if (parent != NULL) { |
if (parent != NULL) { |
if (parent->type == XML_ELEMENT_NODE) { |
if (parent->type == XML_ELEMENT_NODE) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding child %s to %s\n", name, parent->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding child %s to %s\n", name, parent->name); |
#endif |
#endif |
xmlAddChild(parent, ret); |
xmlAddChild(parent, ret); |
} else { |
} else { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding sibling %s to ", name); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding sibling %s to ", name); |
xmlDebugDumpOneNode(stderr, parent, 0); |
xmlDebugDumpOneNode(stderr, parent, 0); |
#endif |
#endif |
xmlAddSibling(parent, ret); |
xmlAddSibling(parent, ret); |
Line 1059 endElement(void *ctx, const xmlChar *nam
|
Line 1077 endElement(void *ctx, const xmlChar *nam
|
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
if (name == NULL) |
if (name == NULL) |
fprintf(stderr, "SAX.endElement(NULL)\n"); |
xmlGenericError(xmlGenericErrorContext, "SAX.endElement(NULL)\n"); |
else |
else |
fprintf(stderr, "SAX.endElement(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, "SAX.endElement(%s)\n", name); |
#endif |
#endif |
|
|
/* Capture end position and add node */ |
/* Capture end position and add node */ |
Line 1083 endElement(void *ctx, const xmlChar *nam
|
Line 1101 endElement(void *ctx, const xmlChar *nam
|
* end of parsing of this node. |
* end of parsing of this node. |
*/ |
*/ |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "popping(%s)\n", cur->name); |
xmlGenericError(xmlGenericErrorContext, "popping(%s)\n", cur->name); |
#endif |
#endif |
nodePop(ctxt); |
nodePop(ctxt); |
} |
} |
Line 1102 reference(void *ctx, const xmlChar *name
|
Line 1120 reference(void *ctx, const xmlChar *name
|
xmlNodePtr ret; |
xmlNodePtr ret; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.reference(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.reference(%s)\n", name); |
#endif |
#endif |
if (name[0] == '#') |
if (name[0] == '#') |
ret = xmlNewCharRef(ctxt->myDoc, name); |
ret = xmlNewCharRef(ctxt->myDoc, name); |
else |
else |
ret = xmlNewReference(ctxt->myDoc, name); |
ret = xmlNewReference(ctxt->myDoc, name); |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "add reference %s to %s \n", name, ctxt->node->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"add reference %s to %s \n", name, ctxt->node->name); |
#endif |
#endif |
xmlAddChild(ctxt->node, ret); |
xmlAddChild(ctxt->node, ret); |
} |
} |
Line 1130 characters(void *ctx, const xmlChar *ch,
|
Line 1150 characters(void *ctx, const xmlChar *ch,
|
xmlNodePtr lastChild; |
xmlNodePtr lastChild; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.characters(%.30s, %d)\n", ch, len); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.characters(%.30s, %d)\n", ch, len); |
#endif |
#endif |
/* |
/* |
* Handle the data if any. If there is no child |
* Handle the data if any. If there is no child |
Line 1140 characters(void *ctx, const xmlChar *ch,
|
Line 1161 characters(void *ctx, const xmlChar *ch,
|
|
|
if (ctxt->node == NULL) { |
if (ctxt->node == NULL) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "add chars: ctxt->node == NULL !\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"add chars: ctxt->node == NULL !\n"); |
#endif |
#endif |
return; |
return; |
} |
} |
lastChild = xmlGetLastChild(ctxt->node); |
lastChild = xmlGetLastChild(ctxt->node); |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "add chars to %s \n", ctxt->node->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"add chars to %s \n", ctxt->node->name); |
#endif |
#endif |
|
|
/* |
/* |
Line 1222 ignorableWhitespace(void *ctx, const xml
|
Line 1245 ignorableWhitespace(void *ctx, const xml
|
{ |
{ |
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ |
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.ignorableWhitespace(%.30s, %d)\n", ch, len); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.ignorableWhitespace(%.30s, %d)\n", ch, len); |
#endif |
#endif |
} |
} |
|
|
Line 1243 processingInstruction(void *ctx, const x
|
Line 1267 processingInstruction(void *ctx, const x
|
xmlNodePtr parent = ctxt->node; |
xmlNodePtr parent = ctxt->node; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.processingInstruction(%s, %s)\n", target, data); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.processingInstruction(%s, %s)\n", target, data); |
#endif |
#endif |
|
|
ret = xmlNewPI(target, data); |
ret = xmlNewPI(target, data); |
Line 1259 processingInstruction(void *ctx, const x
|
Line 1284 processingInstruction(void *ctx, const x
|
} |
} |
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { |
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "Setting PI %s as root\n", target); |
xmlGenericError(xmlGenericErrorContext, |
|
"Setting PI %s as root\n", target); |
#endif |
#endif |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
return; |
return; |
} |
} |
if (parent->type == XML_ELEMENT_NODE) { |
if (parent->type == XML_ELEMENT_NODE) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding PI %s child to %s\n", target, parent->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding PI %s child to %s\n", target, parent->name); |
#endif |
#endif |
xmlAddChild(parent, ret); |
xmlAddChild(parent, ret); |
} else { |
} else { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding PI %s sibling to ", target); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding PI %s sibling to ", target); |
xmlDebugDumpOneNode(stderr, parent, 0); |
xmlDebugDumpOneNode(stderr, parent, 0); |
#endif |
#endif |
xmlAddSibling(parent, ret); |
xmlAddSibling(parent, ret); |
Line 1291 globalNamespace(void *ctx, const xmlChar
|
Line 1319 globalNamespace(void *ctx, const xmlChar
|
{ |
{ |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.globalNamespace(%s, %s)\n", href, prefix); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.globalNamespace(%s, %s)\n", href, prefix); |
#endif |
#endif |
xmlNewGlobalNs(ctxt->myDoc, href, prefix); |
xmlNewGlobalNs(ctxt->myDoc, href, prefix); |
} |
} |
Line 1312 setNamespace(void *ctx, const xmlChar *n
|
Line 1341 setNamespace(void *ctx, const xmlChar *n
|
xmlNodePtr parent; |
xmlNodePtr parent; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.setNamespace(%s)\n", name); |
xmlGenericError(xmlGenericErrorContext, "SAX.setNamespace(%s)\n", name); |
#endif |
#endif |
ns = xmlSearchNs(ctxt->myDoc, ctxt->node, name); |
ns = xmlSearchNs(ctxt->myDoc, ctxt->node, name); |
if (ns == NULL) { /* ctxt->node may not have a parent yet ! */ |
if (ns == NULL) { /* ctxt->node may not have a parent yet ! */ |
Line 1341 getNamespace(void *ctx)
|
Line 1370 getNamespace(void *ctx)
|
xmlNsPtr ret; |
xmlNsPtr ret; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.getNamespace()\n"); |
xmlGenericError(xmlGenericErrorContext, "SAX.getNamespace()\n"); |
#endif |
#endif |
ret = ctxt->node->ns; |
ret = ctxt->node->ns; |
return(ret); |
return(ret); |
Line 1365 checkNamespace(void *ctx, xmlChar *names
|
Line 1394 checkNamespace(void *ctx, xmlChar *names
|
xmlNodePtr cur = ctxt->node; |
xmlNodePtr cur = ctxt->node; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.checkNamespace(%s)\n", namespace); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.checkNamespace(%s)\n", namespace); |
#endif |
#endif |
|
|
/* |
/* |
Line 1412 namespaceDecl(void *ctx, const xmlChar *
|
Line 1442 namespaceDecl(void *ctx, const xmlChar *
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
if (prefix == NULL) |
if (prefix == NULL) |
fprintf(stderr, "SAX.namespaceDecl(%s, NULL)\n", href); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.namespaceDecl(%s, NULL)\n", href); |
else |
else |
fprintf(stderr, "SAX.namespaceDecl(%s, %s)\n", href, prefix); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.namespaceDecl(%s, %s)\n", href, prefix); |
#endif |
#endif |
xmlNewNs(ctxt->node, href, prefix); |
xmlNewNs(ctxt->node, href, prefix); |
} |
} |
Line 1434 comment(void *ctx, const xmlChar *value)
|
Line 1466 comment(void *ctx, const xmlChar *value)
|
xmlNodePtr parent = ctxt->node; |
xmlNodePtr parent = ctxt->node; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.comment(%s)\n", value); |
xmlGenericError(xmlGenericErrorContext, "SAX.comment(%s)\n", value); |
#endif |
#endif |
ret = xmlNewDocComment(ctxt->myDoc, value); |
ret = xmlNewDocComment(ctxt->myDoc, value); |
if (ret == NULL) return; |
if (ret == NULL) return; |
Line 1448 comment(void *ctx, const xmlChar *value)
|
Line 1480 comment(void *ctx, const xmlChar *value)
|
} |
} |
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { |
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "Setting comment as root\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"Setting comment as root\n"); |
#endif |
#endif |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); |
return; |
return; |
} |
} |
if (parent->type == XML_ELEMENT_NODE) { |
if (parent->type == XML_ELEMENT_NODE) { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding comment child to %s\n", parent->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding comment child to %s\n", parent->name); |
#endif |
#endif |
xmlAddChild(parent, ret); |
xmlAddChild(parent, ret); |
} else { |
} else { |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "adding comment sibling to "); |
xmlGenericError(xmlGenericErrorContext, |
|
"adding comment sibling to "); |
xmlDebugDumpOneNode(stderr, parent, 0); |
xmlDebugDumpOneNode(stderr, parent, 0); |
#endif |
#endif |
xmlAddSibling(parent, ret); |
xmlAddSibling(parent, ret); |
Line 1482 cdataBlock(void *ctx, const xmlChar *val
|
Line 1517 cdataBlock(void *ctx, const xmlChar *val
|
xmlNodePtr ret, lastChild; |
xmlNodePtr ret, lastChild; |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.pcdata(%.10s, %d)\n", value, len); |
xmlGenericError(xmlGenericErrorContext, |
|
"SAX.pcdata(%.10s, %d)\n", value, len); |
#endif |
#endif |
lastChild = xmlGetLastChild(ctxt->node); |
lastChild = xmlGetLastChild(ctxt->node); |
#ifdef DEBUG_SAX_TREE |
#ifdef DEBUG_SAX_TREE |
fprintf(stderr, "add chars to %s \n", ctxt->node->name); |
xmlGenericError(xmlGenericErrorContext, |
|
"add chars to %s \n", ctxt->node->name); |
#endif |
#endif |
if ((lastChild != NULL) && |
if ((lastChild != NULL) && |
(lastChild->type == XML_CDATA_SECTION_NODE)) { |
(lastChild->type == XML_CDATA_SECTION_NODE)) { |