Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::xom::Attribute Class Reference

#include <elm/xom/Attribute.h>

+ Inheritance diagram for elm::xom::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 elm::xom::Node
virtual ~Node (void)
 
void * getNode (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 elm::xom::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 elm::xom::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 elm::xom::Node
static void freeNode (void *node)
 
- Protected Attributes inherited from elm::xom::Node
void * node
 

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

elm::xom::Attribute::Attribute ( Attribute attribute)

Unsupported.

elm::xom::Attribute::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

References elm::value().

elm::xom::Attribute::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

References elm::value().

Member Function Documentation

Node * elm::xom::Attribute::copy ( void  )
virtual

Unsupported.

Implements elm::xom::Node.

String elm::xom::Attribute::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. , (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 elm::xom::Node.

Node * elm::xom::Attribute::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 elm::xom::Node.

int elm::xom::Attribute::getChildCount ( void  )
virtual

Implements elm::xom::Node.

String elm::xom::Attribute::getLocalName ( void  ) const

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

Returns
the attribute's local name Unsupported.

References elm::xom::Node::node.

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

String elm::xom::Attribute::getNamespacePrefix ( void  ) const

Unsupported.

String elm::xom::Attribute::getNamespaceURI ( void  ) const

Unsupported.

References elm::xom::Node::node.

String elm::xom::Attribute::getQualifiedName ( void  ) const

Unspported.

String elm::xom::Attribute::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 elm::xom::Node.

References elm::xom::Node::internGetValue().

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

void elm::xom::Attribute::setLocalName ( String  localName)

Unsupported.

void elm::xom::Attribute::setNamespace ( String  prefix,
String  URI 
)

Unsupported.

void elm::xom::Attribute::setValue ( String  value)

Unsupported.

String elm::xom::Attribute::toXML ( void  )
virtual

Unsupported.

Implements elm::xom::Node.


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