The DOMAttr class
(PHP 5, PHP 7, PHP 8)
简介
DOMAttr represents an attribute in the DOMElement object.
类摘要
class DOMAttr
extends
DOMNode
{
/* 属性 */
/* 继承的属性 */
/* 方法 */
/* 继承的方法 */
public DOMNode::C14N(
bool
bool
?array
?array
): string|false
bool
$exclusive
= false
,bool
$withComments
= false
,?array
$xpath
= null
,?array
$nsPrefixes
= null
): string|false
public DOMNode::C14NFile(
string
bool
bool
?array
?array
): int|false
}string
$uri
,bool
$exclusive
= false
,bool
$withComments
= false
,?array
$xpath
= null
,?array
$nsPrefixes
= null
): int|false
属性
- name
-
The name of the attribute.
- ownerElement
-
The element which contains the attribute or
null
. - schemaTypeInfo
-
Not implemented yet, always is
null
. - specified
-
Not implemented yet, always is
true
. - value
-
The value of the attribute.
目录
- DOMAttr::__construct — Creates a new DOMAttr object
- DOMAttr::isId — Checks if attribute is a defined ID

User Contributed Notes 2 notes
greubel at nkey dot de ¶
7 years ago
Please take care on debugging DOMAttr related code. This will cause an E_WARNING that retrieving schemaTypeInfo attribute is not implemented yet. An IDE like Eclipse will inspect the object and its member elements. In conjunction with registered error handlers, which will translate the E_WARNING into Exception your debugging session will end unexpectedly. This has caused me some trouble while debugging my PHPUnit test case in eclipse using "Makegood" plugin.
A possible workarround is to deactivate the error handling during debugging using error_reporting(0). Remove the statement after finishing your debugging session.
Notable ticket in Bugtracker: https://bugs.php.net/bug.php?id=61858
And a xdebug tracker ticket: http://bugs.xdebug.org/view.php?id=910
chregu at php dot net ¶
13 years ago
See also the properties from the inherited class DOMNode ( http://php.net/manual/en/class.domnode.php ), eg. namespaceURI, prefix, localName, etc, especially if you have to deal with namespaced attributes