mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03: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:
@ -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>
|
Tue Sep 23 11:00:18 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: make sure xmlDetectSAX2() is called only at
|
* 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
|
xmlParserCtxtPtr
|
||||||
xmlCreateDocParserCtxt(xmlChar *cur) {
|
xmlCreateDocParserCtxt(xmlChar *cur) {
|
||||||
int len;
|
int len;
|
||||||
xmlParserCtxtPtr ctxt;
|
|
||||||
xmlParserInputPtr input;
|
|
||||||
xmlParserInputBufferPtr buf;
|
|
||||||
|
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
len = xmlStrlen(cur);
|
len = xmlStrlen(cur);
|
||||||
|
return(xmlCreateMemoryParserCtxt((char *)cur, len));
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user