mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08:00
revert xmlCreateDocParserCtxt() since this break the parseDoc() python
* parser.c: revert xmlCreateDocParserCtxt() since this break the parseDoc() python bindings Daniel
This commit is contained in:
parent
309f81d503
commit
1f40d68043
@ -1,3 +1,8 @@
|
||||
Tue Sep 23 11:15:23 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c: revert xmlCreateDocParserCtxt() since this break
|
||||
the parseDoc() python bindings
|
||||
|
||||
Tue Sep 23 11:00:18 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c: make sure xmlDetectSAX2() is called only at
|
||||
|
31
parser.c
31
parser.c
@ -11742,40 +11742,11 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data,
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateDocParserCtxt(xmlChar *cur) {
|
||||
int len;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
xmlParserInputPtr input;
|
||||
xmlParserInputBufferPtr buf;
|
||||
|
||||
if (cur == NULL)
|
||||
return(NULL);
|
||||
len = xmlStrlen(cur);
|
||||
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL)
|
||||
return(NULL);
|
||||
|
||||
buf = xmlParserInputBufferCreateStatic((char *)cur, len,
|
||||
XML_CHAR_ENCODING_NONE);
|
||||
if (buf == NULL) {
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
input = xmlNewInputStream(ctxt);
|
||||
if (input == NULL) {
|
||||
xmlFreeParserInputBuffer(buf);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
input->filename = NULL;
|
||||
input->buf = buf;
|
||||
input->base = input->buf->buffer->content;
|
||||
input->cur = input->buf->buffer->content;
|
||||
input->end = &input->buf->buffer->content[input->buf->buffer->use];
|
||||
|
||||
inputPush(ctxt, input);
|
||||
return(ctxt);
|
||||
return(xmlCreateMemoryParserCtxt((char *)cur, len));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user