tag_has_attr
tag_has_attr (tagname, attr[, doc[, dtdOnly]])
This function returns 1 (True) if the tag tagname has an attribute named attr. If the tag doesn't have the specified attribute, 0 is returned.
|
If you have applied an alias map to the document, tagname and attr can be either aliases or real names.
|
The doc argument specifies the identifier of the document tree. If doc is omitted or 0, the current document is used.
If the value specified by dtdOnly is omitted or is 1, then the function will only return 1 for tags and attributes that are declared in the DTD or XML schema. If the value specified by dtdOnly is 0, then the function will also return 1 if attr is an undeclared attribute that has been seen on the tag tagname.
For a Free-form XML document, the dtdOnly parameter is ignored. The function will return 1 if attr is seen on the tag tagname.
|
If the DTD for your document includes the NAMECASE GENERAL NO setting, then the tagname parameter will be case sensitive.
|
Related Topics