/* }}} */
/*
-* class DOMDocument extends DOMNode
+* class DOMDocument extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
-* Since:
+* Since:
*/
const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
};
/* }}} */
-/* {{{ docType DOMDocumentType
-readonly=yes
+/* {{{ docType DOMDocumentType
+readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
-Since:
+Since:
*/
int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
{
return FAILURE;
}
return SUCCESS;
-
+
}
/* }}} */
-/* {{{ implementation DOMImplementation
-readonly=yes
+/* {{{ implementation DOMImplementation
+readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
-Since:
+Since:
*/
int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
{
/* }}} */
-/* {{{ documentElement DOMElement
-readonly=yes
+/* {{{ documentElement DOMElement
+readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
-Since:
+Since:
*/
int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
{
/* }}} */
-/* {{{ standalone boolean
-readonly=no
+/* {{{ standalone boolean
+readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
Since: DOM Level 3
*/
/* }}} */
-/* {{{ version string
+/* {{{ version string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
Since: DOM Level 3
/* }}} */
-/* {{{ strictErrorChecking boolean
-readonly=no
+/* {{{ strictErrorChecking boolean
+readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
Since: DOM Level 3
*/
/* }}} */
-/* {{{ formatOutput boolean
+/* {{{ formatOutput boolean
readonly=no
*/
int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ validateOnParse boolean
+/* {{{ validateOnParse boolean
readonly=no
*/
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ resolveExternals boolean
+/* {{{ resolveExternals boolean
readonly=no
*/
int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ preserveWhiteSpace boolean
+/* {{{ preserveWhiteSpace boolean
readonly=no
*/
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ recover boolean
+/* {{{ recover boolean
readonly=no
*/
int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ substituteEntities boolean
+/* {{{ substituteEntities boolean
readonly=no
*/
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
-/* {{{ documentURI string
-readonly=no
+/* {{{ documentURI string
+readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
Since: DOM Level 3
*/
/* }}} */
-/* {{{ config DOMConfiguration
-readonly=yes
+/* {{{ config DOMConfiguration
+readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
Since: DOM Level 3
*/
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_element)
{
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_document_fragment)
{
/* {{{ proto DOMText dom_document_create_text_node(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_text_node)
{
/* {{{ proto DOMComment dom_document_create_comment(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_comment)
{
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_cdatasection)
{
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_processing_instruction)
{
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_attribute)
{
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_create_entity_reference)
{
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
-Since:
+Since:
*/
PHP_FUNCTION(dom_document_get_elements_by_tag_name)
{
xmlDocPtr docp;
xmlNodePtr nodep, retnodep;
dom_object *intern, *nodeobj;
- int ret;
+ int ret;
long recursive = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj);
- if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
+ if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
RETURN_FALSE;
RETURN_FALSE;
}
-
+
nodep->ns = nsptr;
DOM_RET_OBJ(nodep, &ret, intern);
xmlInitParser();
if (mode == DOM_LOAD_FILE) {
+ char *file_dest;
if (CHECK_NULL_PATH(source, source_len)) {
return NULL;
}
- char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
if (file_dest) {
ctxt = xmlCreateFileParserCtxt(file_dest);
}
-
+
} else {
ctxt = xmlCreateMemoryParserCtxt(source, source_len);
}
zval *id;
xmlDoc *docp;
xmlNodePtr root;
- long flags = 0;
+ long flags = 0;
int err;
dom_object *intern;
err = xmlXIncludeProcessFlags(docp, flags);
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
- are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
+ are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
but are not wanted in resulting document - must be done even if err as it could fail after
having processed some xincludes */
root = (xmlNodePtr) docp->children;
} else {
RETVAL_FALSE;
}
-
+
}
/* }}} */
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
cvp = xmlNewValidCtxt();
-
+
cvp->userData = NULL;
cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler;
cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler;
-
+
if (xmlValidateDocument(cvp, docp)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
}
-
+
xmlFreeValidCtxt(cvp);
-
+
}
/* }}} */
break;
case DOM_LOAD_STRING:
parser = xmlSchemaNewMemParserCtxt(source, source_len);
- /* If loading from memory, we need to set the base directory for the document
+ /* If loading from memory, we need to set the base directory for the document
but it is not apparent how to do that for schema's */
break;
default:
break;
case DOM_LOAD_STRING:
parser = xmlRelaxNGNewMemParserCtxt(source, source_len);
- /* If loading from memory, we need to set the base directory for the document
+ /* If loading from memory, we need to set the base directory for the document
but it is not apparent how to do that for schema's */
break;
default:
int source_len, refcount, ret;
long options = 0;
htmlParserCtxtPtr ctxt;
-
+
id = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
htmlParseDocument(ctxt);
newdoc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
-
+
if (!newdoc)
RETURN_FALSE;
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
-
+
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
-
+
if (node->type == XML_DOCUMENT_FRAG_NODE) {
int one_size;