Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Attribute Class Reference

#include <elm/xom/Attribute.h>

+ Inheritance diagram for Attribute:

Public Member Functions

 Attribute (Attribute *attribute)
 
 Attribute (String localName, String value)
 
 Attribute (String name, String URI, String value)
 
String getLocalName (void) const
 
String getNamespacePrefix (void) const
 
String getNamespaceURI (void) const
 
String getQualifiedName (void) const
 
void setLocalName (String localName)
 
void setNamespace (String prefix, String URI)
 
void setValue (String value)
 
virtual Nodecopy (void)
 
virtual String getValue (void)
 
virtual String toXML (void)
 
virtual String getBaseURI (void)
 
virtual NodegetChild (int index)
 
virtual int getChildCount (void)
 
- Public Member Functions inherited from Node
virtual ~Node (void)
 
voidgetNode (void) const
 
kind_t kind (void) const
 
void detach (void)
 
bool equals (const Node *node) const
 
virtual DocumentgetDocument (void)
 
virtual ParentNodegetParent (void)
 
virtual Nodesquery (const String &xpath)
 
virtual Nodesquery (const String &xpath, XPathContext *context)
 
int line (void) const
 

Additional Inherited Members

- Public Types inherited from Node
enum  kind_t {
  NONE = 0, ELEMENT, DOCUMENT, TEXT,
  COMMENT, ATTRIBUTE, PROCESSING_INSTRUCTION, DOCTYPE,
  NAMESPACE
}
 
typedef enum elm::xom::Node::kind_t kind_t
 
- Protected Member Functions inherited from Node
 Node (void *_node)
 
void setNode (void *_node)
 
Nodemake (void *node)
 
Nodeget (void *node)
 
NodeinternCopy (void)
 
NodeinternGetChild (int index)
 
int internGetChildCount (void)
 
String internGetValue (void)
 
String internToXML (void)
 
- Static Protected Member Functions inherited from Node
static void freeNode (void *node)
 
- Protected Attributes inherited from Node
voidnode
 

Detailed Description

This class represents an attribute such as type="empty" or xlink:href="http://www.example.com".

Attributes that declare namespaces such as xmlns="http://www.w3.org/TR/1999/xhtml" or xmlns:xlink="http://www.w3.org/TR/1999/xlink" are stored separately on the elements where they appear. They are never represented as Attribute objects.

Author
H. Cassé casse.nosp@m.@iri.nosp@m.t.fr

Constructor & Destructor Documentation

◆ Attribute() [1/3]

Attribute ( Attribute attribute)

Unsupported.

◆ Attribute() [2/3]

Attribute ( String  localName,
String  value 
)

Creates a new attribute in no namespace with the specified name and value and undeclared type.

Parameters
localNamethe unprefixed attribute name
valuethe attribute value

◆ Attribute() [3/3]

Attribute ( String  localName,
String  URI,
String  value 
)

Creates a new attribute in the specified namespace with the specified name and value and undeclared type.

Parameters
localNamethe prefixed attribute name
URIthe namespace URI
valuethe attribute value

Member Function Documentation

◆ copy()

Node * copy ( void  )
virtual

Unsupported.

Implements Node.

◆ getBaseURI()

String getBaseURI ( void  )
virtual

Returns the base URI of this node as specified by XML Base, or the empty string if this is not known. In most cases, this is the URL against which relative URLs in this node should be resolved.

The base URI of a non-parent node is the base URI of the element containing the node. The base URI of a document node is the URI from which the document was parsed, or which was set by calling setBaseURI on on the document.
The base URI of an element is determined as follows:
  • If the element has an xml:base attribute, then the value of that attribute is converted from an IRI to a URI, absolutized if possible, and returned.
  • Otherwise, if any ancestor element of the element loaded from the same entity has an xml:base attribute, then the value of that attribute from the nearest such ancestor is converted from an IRI to a URI, absolutized if possible, and returned. xml:base attributes from other entities are not considered.
  • Otherwise, if setBaseURI() has been invoked on this element, then the URI most recently passed to that method is absolutized if possible and returned.
  • Otherwise, if the element comes from an externally parsed entity or the document entity, and the original base URI has not been changed by invoking setBaseURI(), then the URI of that entity is returned. @liOtherwise, (the element was created by a constructor rather then being parsed from an existing document), the base URI of the nearest ancestor that does have a base URI is returned. If no ancestors have a base URI, then the empty string is returned.
Absolutization takes place as specified by the XML Base specification. However, it is not always possible to absolutize a relative URI, in which case the empty string will be returned.
Returns
the base URI of this node. This string must be fried by the caller.

Reimplemented from Node.

◆ getChild()

Node * getChild ( int  index)
virtual

Returns the child of this node at the specified position.

Parameters
positionthe index of the child node to return
Returns
the positionth child node of this node

Implements Node.

◆ getChildCount()

int getChildCount ( void  )
virtual

Implements Node.

◆ getLocalName()

String getLocalName ( void  ) const

Returns the local name of this attribute, not including the prefix.

Returns
the attribute's local name Unsupported.

References Node::node.

Referenced by Element::addAttribute(), and Serializer::write().

◆ getNamespacePrefix()

String getNamespacePrefix ( void  ) const

Unsupported.

◆ getNamespaceURI()

String getNamespaceURI ( void  ) const

Unsupported.

References Node::node.

◆ getQualifiedName()

String getQualifiedName ( void  ) const

Unspported.

◆ getValue()

String getValue ( void  )
virtual

Get the node as a string with markup removed.

Returns
Text value of the node. The returned string must be fried by the caller.

Implements Node.

References CString::chars(), Node::internGetValue(), and String::toCString().

Referenced by Element::addAttribute(), and Serializer::write().

◆ setLocalName()

void setLocalName ( String  localName)

Unsupported.

◆ setNamespace()

void setNamespace ( String  prefix,
String  URI 
)

Unsupported.

◆ setValue()

void setValue ( String  value)

Unsupported.

◆ toXML()

String toXML ( void  )
virtual

Unsupported.

Implements Node.


The documentation for this class was generated from the following files: