mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
add appendXML() to DOMFragment (chregu)
This commit is contained in:
parent
a7f36a5825
commit
5c17925a7c
@ -37,6 +37,7 @@
|
||||
|
||||
zend_function_entry php_dom_documentfragment_class_functions[] = {
|
||||
PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(domdocumentfragment, appendXML, NULL, ZEND_ACC_PUBLIC)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@ -73,4 +74,32 @@ PHP_METHOD(domdocumentfragment, __construct)
|
||||
}
|
||||
}
|
||||
/* }}} end DOMDocumentFragment::__construct */
|
||||
|
||||
/* {{{ proto void DOMDocumentFragment::appendXML(string data); */
|
||||
PHP_METHOD(domdocumentfragment, appendXML) {
|
||||
zval *id;
|
||||
xmlNode *nodep;
|
||||
dom_object *intern;
|
||||
char *data = NULL;
|
||||
int data_len = 0;
|
||||
int err;
|
||||
xmlNodePtr lst;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
|
||||
|
||||
if (data) {
|
||||
err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst);
|
||||
if (err != 0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
xmlAddChildList(nodep,lst);
|
||||
}
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -102,6 +102,7 @@ PHP_METHOD(domimplementation, getFeature);
|
||||
|
||||
/* domdocumentfragment methods */
|
||||
PHP_METHOD(domdocumentfragment, __construct);
|
||||
PHP_METHOD(domdocumentfragment, appendXML);
|
||||
|
||||
/* domdocument methods */
|
||||
PHP_FUNCTION(dom_document_create_element);
|
||||
|
Loading…
Reference in New Issue
Block a user