User Tools

Site Tools


DzDomElement

Represents a Document Object Model (DOM) “Element”.

More...

Inherits :

Properties

DAZ Script
StringtagName

Methods

DAZ Script
Stringattribute ( String name, String defValue=“” )
DzDomNodeattributeNode ( String name )
DzDomNodeattributeNodeNS ( String nsURI, String localName )
StringattributeNS ( String nsURI, String localName, String defValue=“” )
Objectattributes ()
ArrayelementsByTagName ( String tagName )
ArrayelementsByTagNameNS ( String nsURI, String localName )
BooleanhasAttribute ( String name )
BooleanhasAttributeNS ( String nsURI, String localName )
voidremoveAttribute ( String name )
DzDomNoderemoveAttributeNode ( DzDomAttr attr )
voidremoveAttributeNS ( String nsURI, String localName )
voidsetAttribute ( String name, String value )
DzDomNodesetAttributeNode ( DzDomAttr attr )
DzDomNodesetAttributeNodeNS ( DzDomAttr attr )
voidsetAttributeNS ( String nsURI, String qName, String value )

Detailed Description

A DAZScript wrapper for QDomElement. This object represents an “Element” in a DOM document.

Instances of this object are not constructed directly, rather they are returned by calling DzDomDocument::createElement().

Properties


String : tagName

Holds the tag name of this element.

Methods


String : attribute( String name, String defValue=“” )

Parameter(s):

  • name - The name of the attribute to retrieve the value of.
  • defValue - The default value if the specified attribute does not already exist.

Return Value:

  • The value of the attribute with the specified name (if any), otherwise the value specified by defValue.

DzDomNode : attributeNode( String name )

Parameter(s):

  • name - The name of the attribute on this element to retrieve a node for.

Return Value:

  • The node that represents the name attribute (if any), otherwise a DzDomBasicNode.

DzDomNode : attributeNodeNS( String nsURI, String localName )

Parameter(s):

  • nsURI - The namespace of the attribute to retrieve the value of.
  • localName - The name of the attribute to retrieve the value of.

Return Value:

  • The node that represents the attribute (if any) in the specified namespace, with the specified name, otherwise a DzDomBasicNode.

String : attributeNS( String nsURI, String localName, String defValue=“” )

Parameter(s):

  • nsURI - The namespace of the attribute to retrieve the value of.
  • localName - The name of the attribute to retrieve the value of.
  • defValue - The default value if the specified attribute does not already exist.

Return Value:

  • The value of the attribute (if any) in the specified namespace, with the specified name, otherwise the value specified by defValue.

Object : attributes()

Return Value:

  • An Object where the attributes of this node are represented as its properties (keys) and their values correspond to the attribute values.

Since:

  • 4.11.0.279

Array : elementsByTagName( String tagName )

Parameter(s):

  • tagName - The name of descendant elements to retrieve.

Return Value:

  • A list of descendant elements named tagName (if any), in the order they were encountered.

Since:

  • 4.11.0.279

Array : elementsByTagNameNS( String nsURI, String localName )

Parameter(s):

  • nsURI - The namespace of descendant elements to retrieve.
  • localName - The name of descendant elements to retrieve.

Return Value:

  • A list of descendant elements (if any), in the specified namespace, with the specified name, in the order they were encountered.

Since:

  • 4.11.0.279

Boolean : hasAttribute( String name )

Parameter(s):

  • name - The name of the attribute to check.

Return Value:

  • true if the element has an attribute with the specified name, otherwise false.

Boolean : hasAttributeNS( String nsURI, String localName )

Parameter(s):

  • nsURI - The namespace of the attribute to check.
  • localName - The name of the attribute to check.

Return Value:

  • true if the element has an attribute, in the specified namespace, with the specified name, otherwise false.

void : removeAttribute( String name )

Removes an attribute from this element.

Parameter(s):

  • name - The name of the attribute to remove.

DzDomNode : removeAttributeNode( DzDomAttr attr )

Removes an attribute from this element.

Parameter(s):

  • attr - The node for the attribute to remove.

Return Value:

  • The attribute that was removed (if any), otherwise a DzDomBasicNode.

See Also:


void : removeAttributeNS( String nsURI, String localName )

Removes an attribute, in the specified namespace, from this element.

Parameter(s):

  • nsURI - The namespace of the attribute to remove.
  • localName - The name of the attribute to remove.

void : setAttribute( String name, String value )

Sets (or adds) an attribute with the specified name/value on this element.

Parameter(s):

  • name - The name of the attribute to set.
  • value - The value to set the attribute to.

See Also:


DzDomNode : setAttributeNode( DzDomAttr attr )

Sets (or adds) an attribute to this element using a DzDomAttr node.

Parameter(s):

  • attr - The node to set/add the attribute with.

Return Value:

  • The node for the attribute that was replaced by attr. If no attribute was replaced, a DzDomBasicNode is returned.

See Also:


DzDomNode : setAttributeNodeNS( DzDomAttr attr )

Sets (or adds) an attribute to this element using a DzDomAttr node.

Parameter(s):

  • attr - The node to set/add the attribute with.

Return Value:

  • The node for the attribute that was replaced (if any) by attr, otherwise a DzDomBasicNode.

See Also:


void : setAttributeNS( String nsURI, String qName, String value )

Sets (or adds) an attribute with the specified name/value, in the specified namespace, on this element.

Parameter(s):

  • nsURI - The namespace of the attribute to set.
  • qName - The qualified name of the attribute to set.
  • value - The value to set the attribute to.

See Also: