Class: cXMLDOMAttribute

Properties  Events  Methods    Index of Classes

XML class for handling an attribute node

Hierarchy

cObject
---BaseXmlDomNode
------BaseXmlDomAttribute
---------cXMLDOMAttribute

Library: Common (Windows and Web Application) Class Library

Package: Flexml.pkg

Mixins: cXMLDOMNodeMixin cXMLDOMMixin

Description

This class is used to create an attribute node object. The object is created by sending the CreateAttributeNode message to an element node object (cXmlDomElement).

Get CreateAttributeNode of hoElement "Attr-Name" "Attr-Value" to hoAttribute


Attribute processing within Element Node objects

Attribute node objects are rarely created in XML processing. Attributes, which can only be children of Elements, are usually handled with the attribute handling interfaces provided within the cXMLDomElement class. Those Interfaces are AddAttribute, AttributeNodes, EnumerateAttributes, RemoveAttribute and SetAttributeValue.


Of Note

An attribute is regarded as being a property of an element, rather than a distinct part of a document. As such, attributes have no parents or siblings and the object's ParentNode, PreviousSibling and NextSibling properties have null values. They cannot have child nodes. Typically, the allowable values for the attribute are defined in a document type definition (DTD).

In objects of this class, the relationship between the value and specified properties can be summarized as follows: If the attribute has an assigned value in the document and the specified property is true, the value is the assigned value. If the attribute has no assigned value in the document and has a default value in the DTD, the specified property is false, and the value is the default value in the DTD. If the attribute has no assigned value in the document and has a value of #IMPLIED in the DTD, the attribute does not appear in the structure model of the document.

In XML, the value of an attribute is represented by the child nodes of the attribute node because the value can contain entity references. Thus, attributes that contain entity references will have a child list containing both text nodes and entity reference nodes. In addition, because the attribute type might be unknown, there are no tokenized attribute values.

Using the XML Classes

The cXmlDomDocument class is the starting point for most XML processing. Refer to the cXmlDomDocument class for more information about the XML Document Object Model (DOM) and using XML within DataFlex. Samples are provided in this section.

See Also

cXmlDomDocument | cXmlDomCDataSection | cXmlDomComment | cXmlDomDocumentFragment | cXmlDomDocumentType | cXmlDomElement | cXmlDomEntity | cXmlDomEntityReference | cXmlDomNamedNodeMap | cXmlDomNode | cXmlDomNodeList | cXmlDomNotation | cXmlDomProcessingInstruction | cXmlDomTextNode | BaseXmlDomParseError