Class: webCGMAttr

webCGMAttr


new webCGMAttr()

webCGMAttr constructor

Methods


getAttributeNS(namespaceIRI, localName) → {string}

Returns the node attribute value by local name and namespace IRI.
Parameters:
Name Type Description
namespaceIRI string The namespace IRI of the attribute to retrieve.
localName string The local name of the attribute to retrieve.
Returns:
The webCGMAttr value as a string, or the empty string if that attribute does not have a specified value.

Type: string


getAttributes() → {webCGMNodeList}

Returns a webCGMNodeList that contains all attributes of this attribute node. If there are no attributes, this returns null.
Returns:
attributes

Type: webCGMNodeList


getChildNodes() → {webCGMNodeList}

Returns a webCGMNodeList that contains all children of this node. If there are no children, this returns null.
Returns:
childNodes

Type: webCGMNodeList


getElementsByTagNameNS(namespaceIRI, localName) → {string}

Returns a webCGMNodeList of all the descendant XML companion file elements(application specific metadata) with a given local name and namespace IRI in the order in which they are encountered in a preorder traversal of the webCGMNode tree. Returns null if there are no such elements.
Parameters:
Name Type Description
namespaceIRI string The namespace IRI of the XML elements to match on.
localName string The local name of the XML elements to match on.
Returns:

Type: string


getFirstChild() → {webCGMNode}

Returns The first child of this node. If there is no such node, this returns null.
Returns:
lastChild

Type: webCGMNode


getLastChild() → {webCGMNode}

Returns The last child of this node. If there is no such node, this returns null.
Returns:
lastChild

Type: webCGMNode


getLocalName() → {string}

Returns the local part of the qualified name of this node (e.g., foo:elementName, returns "elementName"). This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
localName

Type: string


getName() → {string}

Get the name of this attribute. If webCGMNode localName is different from the empty string, this attribute is a qualified name.
Returns:
name

Type: string


getNamespaceIRI() → {string}

Returns The namespace IRI of this node. For example, on the element foo:someElement, returns the IRI of the (xmlns) namespace declaration that associates the prefix foo with the namespace. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is the namespace IRI given at creation time. This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
namespaceIRI

Type: string


getNextSibling() → {webCGMNode}

Returns the node immediately following this node. If there is no such node, this returns null.
Returns:
nextSibling

Type: webCGMNode


getNodeName() → {string}

Returns the name of this node, depending on its type; see table
Returns:
nodeName

Type: string


getNodeType() → {int}

Returns a code representing the type of the underlying object.
Returns:
type

Type: int


getNodeValue() → {string}

Returns the value of this node, depending on its type; see table
Returns:
nodeValue

Type: string


getOwnerNode() → {webCGMNode}

Get the Element node this attribute is attached to or null if this attribute is not in use.
Returns:
node

Type: webCGMNode


getOwnerPicture() → {webCGMNode}

Returns the webCGMPicture object associated with this node. When the node is a webCGMPicture node, this returns null
Returns:
ownerPicture

Type: webCGMNode


getParentNode() → {webCGMNode}

Returns The parent (immediate ancestor node) of this node. All nodes, except webCGMPicture and webCGMAttr, may have a parent.
Returns:
parentNode

Type: webCGMNode


getPrefix() → {string}

Returns the namespace prefix of this node (e.g., foo:elementName, returns "foo"). This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
prefix

Type: string


getPreviousSibling() → {webCGMNode}

Returns the node immediately preceding this node. If there is no such node, this returns null.
Returns:
previousSibling

Type: webCGMNode


getValue() → {string}

Get the value of this attribute
Returns:
value

Type: string


hasAttributes() → {boolean}

Returns whether this attribute node has any attributes. (For more information, see the attributes attribute.)
Returns:
true if this node has any attributes, false otherwise.

Type: boolean


hasChildNodes() → {boolean}

Returns whether this node has any children.
Returns:
true if this node has any children, false otherwise.

Type: boolean


setAttributeNS(namespaceIRI, qualifiedName, value)

Adds a new attribute. If an attribute with that name is already present on the node, its value is changed to be that of the value parameter
Parameters:
Name Type Description
namespaceIRI string The namespace IRI of the attribute to create or alter.
qualifiedName string The qualified name of the attribute to create or alter.
value string The value to set, in string form.