version 1.1.1.1, 2012/02/21 23:47:54
|
version 1.1.1.3, 2013/07/22 01:31:40
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 177 PHP_METHOD(domelement, __construct)
|
Line 177 PHP_METHOD(domelement, __construct)
|
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
/* Namespace logic is seperate and only when uri passed in to insure no BC breakage */ | /* Namespace logic is separate and only when uri passed in to insure no BC breakage */ |
if (uri_len > 0) { |
if (uri_len > 0) { |
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); |
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); |
if (errorcode == 0) { |
if (errorcode == 0) { |
Line 371 Since:
|
Line 371 Since:
|
*/ |
*/ |
PHP_FUNCTION(dom_element_set_attribute) |
PHP_FUNCTION(dom_element_set_attribute) |
{ |
{ |
zval *id, *rv = NULL; | zval *id; |
xmlNode *nodep; |
xmlNode *nodep; |
xmlNodePtr attr = NULL; |
xmlNodePtr attr = NULL; |
int ret, name_len, value_len, name_valid; |
int ret, name_len, value_len, name_valid; |
Line 426 PHP_FUNCTION(dom_element_set_attribute)
|
Line 426 PHP_FUNCTION(dom_element_set_attribute)
|
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
DOM_RET_OBJ(rv, attr, &ret, intern); | DOM_RET_OBJ(attr, &ret, intern); |
|
|
} |
} |
/* }}} end dom_element_set_attribute */ |
/* }}} end dom_element_set_attribute */ |
Line 485 Since:
|
Line 485 Since:
|
*/ |
*/ |
PHP_FUNCTION(dom_element_get_attribute_node) |
PHP_FUNCTION(dom_element_get_attribute_node) |
{ |
{ |
zval *id, *rv = NULL; | zval *id; |
xmlNodePtr nodep, attrp; |
xmlNodePtr nodep, attrp; |
int name_len, ret; |
int name_len, ret; |
dom_object *intern; |
dom_object *intern; |
Line 521 PHP_FUNCTION(dom_element_get_attribute_node)
|
Line 521 PHP_FUNCTION(dom_element_get_attribute_node)
|
attrp->ns = curns; |
attrp->ns = curns; |
} |
} |
|
|
DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); | DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern); |
} |
} |
/* }}} end dom_element_get_attribute_node */ |
/* }}} end dom_element_get_attribute_node */ |
|
|
Line 531 Since:
|
Line 531 Since:
|
*/ |
*/ |
PHP_FUNCTION(dom_element_set_attribute_node) |
PHP_FUNCTION(dom_element_set_attribute_node) |
{ |
{ |
zval *id, *node, *rv = NULL; | zval *id, *node; |
xmlNode *nodep; |
xmlNode *nodep; |
xmlAttr *attrp, *existattrp = NULL; |
xmlAttr *attrp, *existattrp = NULL; |
dom_object *intern, *attrobj, *oldobj; |
dom_object *intern, *attrobj, *oldobj; |
Line 583 PHP_FUNCTION(dom_element_set_attribute_node)
|
Line 583 PHP_FUNCTION(dom_element_set_attribute_node)
|
|
|
/* Returns old property if removed otherwise NULL */ |
/* Returns old property if removed otherwise NULL */ |
if (existattrp != NULL) { |
if (existattrp != NULL) { |
DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); | DOM_RET_OBJ((xmlNodePtr) existattrp, &ret, intern); |
} else { |
} else { |
RETVAL_NULL(); |
RETVAL_NULL(); |
} |
} |
Line 597 Since:
|
Line 597 Since:
|
*/ |
*/ |
PHP_FUNCTION(dom_element_remove_attribute_node) |
PHP_FUNCTION(dom_element_remove_attribute_node) |
{ |
{ |
zval *id, *node, *rv = NULL; | zval *id, *node; |
xmlNode *nodep; |
xmlNode *nodep; |
xmlAttr *attrp; |
xmlAttr *attrp; |
dom_object *intern, *attrobj; |
dom_object *intern, *attrobj; |
Line 623 PHP_FUNCTION(dom_element_remove_attribute_node)
|
Line 623 PHP_FUNCTION(dom_element_remove_attribute_node)
|
|
|
xmlUnlinkNode((xmlNodePtr) attrp); |
xmlUnlinkNode((xmlNodePtr) attrp); |
|
|
DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); | DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern); |
|
|
} |
} |
/* }}} end dom_element_remove_attribute_node */ |
/* }}} end dom_element_remove_attribute_node */ |
Line 832 PHP_FUNCTION(dom_element_set_attribute_ns)
|
Line 832 PHP_FUNCTION(dom_element_set_attribute_ns)
|
} |
} |
|
|
if (errorcode == 0 && is_xmlns == 0) { |
if (errorcode == 0 && is_xmlns == 0) { |
attr = xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); | xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); |
} |
} |
} else { |
} else { |
name_valid = xmlValidateName((xmlChar *) localname, 0); |
name_valid = xmlValidateName((xmlChar *) localname, 0); |
Line 844 PHP_FUNCTION(dom_element_set_attribute_ns)
|
Line 844 PHP_FUNCTION(dom_element_set_attribute_ns)
|
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { |
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { |
node_list_unlink(attr->children TSRMLS_CC); |
node_list_unlink(attr->children TSRMLS_CC); |
} |
} |
attr = xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); | xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); |
} |
} |
} |
} |
} |
} |
Line 925 Since: DOM Level 2
|
Line 925 Since: DOM Level 2
|
*/ |
*/ |
PHP_FUNCTION(dom_element_get_attribute_node_ns) |
PHP_FUNCTION(dom_element_get_attribute_node_ns) |
{ |
{ |
zval *id, *rv = NULL; | zval *id; |
xmlNodePtr elemp; |
xmlNodePtr elemp; |
xmlAttrPtr attrp; |
xmlAttrPtr attrp; |
dom_object *intern; |
dom_object *intern; |
Line 944 PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
Line 944 PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
RETURN_NULL(); |
RETURN_NULL(); |
} |
} |
|
|
DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); | DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern); |
|
|
} |
} |
/* }}} end dom_element_get_attribute_node_ns */ |
/* }}} end dom_element_get_attribute_node_ns */ |
Line 955 Since: DOM Level 2
|
Line 955 Since: DOM Level 2
|
*/ |
*/ |
PHP_FUNCTION(dom_element_set_attribute_node_ns) |
PHP_FUNCTION(dom_element_set_attribute_node_ns) |
{ |
{ |
zval *id, *node, *rv = NULL; | zval *id, *node; |
xmlNode *nodep; |
xmlNode *nodep; |
xmlNs *nsp; |
xmlNs *nsp; |
xmlAttr *attrp, *existattrp = NULL; |
xmlAttr *attrp, *existattrp = NULL; |
Line 1014 PHP_FUNCTION(dom_element_set_attribute_node_ns)
|
Line 1014 PHP_FUNCTION(dom_element_set_attribute_node_ns)
|
|
|
/* Returns old property if removed otherwise NULL */ |
/* Returns old property if removed otherwise NULL */ |
if (existattrp != NULL) { |
if (existattrp != NULL) { |
DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); | DOM_RET_OBJ((xmlNodePtr) existattrp, &ret, intern); |
} else { |
} else { |
RETVAL_NULL(); |
RETVAL_NULL(); |
} |
} |