An XML element abstraction for implementing efficient C++ transformations.
More...
#include <rw/xmlstreams/RWXmlStreamElement.h>
Inherited by RWTXmlStreamPrimitive< T >, RWTXmlStreamPrimitive< char >, RWTXmlStreamPrimitive< RWCString >, RWXmlStreamComment, and RWXmlStreamProlog.
|
| RWXmlStreamElement (const std::list< std::pair< RWCString, RWXmlNamespace > > &namespaces) |
|
| RWXmlStreamElement (const RWXmlName &name, const RWCString &value, const std::list< std::pair< RWCString, RWXmlNamespace > > &namespaces) |
|
| RWXmlStreamElement (const RWXmlName &name, RWXmlStreamElement *element, const std::list< std::pair< RWCString, RWXmlNamespace > > &namespaces) |
|
| RWXmlStreamElement (const RWXmlStreamElement &element) |
|
void | addAttribute (const RWXmlAttribute &attribute) |
|
void | addElement (const RWXmlStreamElement &element) |
|
void | addNamespace (const RWCString &prefix, const RWXmlNamespace &fullname) |
|
void | deleteAttribute (const RWXmlName &name) |
|
void | deleteElement (const RWXmlName &name) |
|
bool | deleteNamespace (const RWCString &prefix) |
|
RWCString | findAttribute (const RWXmlName &name) const |
|
const_iterator | findElement (const RWXmlName &name) const |
|
const RWXmlNamespace | findNamespaceURI (const RWCString &prefix) const |
|
const_iterator | findNextElement (const RWXmlName &name, const_iterator start) const |
|
const RWXmlAttributeSet & | getAttributes () const |
|
const std::list< RWXmlStreamElement * > & | getElements () const |
|
RWXmlName | getName () const |
|
const std::list< std::pair< RWCString, RWXmlNamespace > > & | getNamespaces () const |
|
RWCString | getValue () const |
|
void | resolveNamespaces () |
|
void | setName (const RWXmlName &name) |
|
void | setValue (const RWCString &value) |
|
void | setValue (const RWXmlStreamElement &element) |
|
This class represents an XML element abstraction for implementing efficient C++ transformations.
A typedef for the type of element.
RWXmlStreamElement::RWXmlStreamElement |
( |
const std::list< std::pair< RWCString, RWXmlNamespace > > & |
namespaces | ) |
|
|
inline |
This constructor takes a set of namespaces valid in the scope of this element. The parameter namespaces holds a set of RWCString / RWXmlNamespace pairs.
RWXmlStreamElement::RWXmlStreamElement |
( |
const RWXmlName & |
name, |
|
|
const RWCString & |
value, |
|
|
const std::list< std::pair< RWCString, RWXmlNamespace > > & |
namespaces |
|
) |
| |
This constructor takes a name for the element, a CDATA
value, and a list of namespaces. The parameter name contains a name for this element. The parameter value contains CDATA
for the content of this element. The parameter namespaces holds a set of RWCString / RWXmlNamespace pairs.
RWXmlStreamElement::RWXmlStreamElement |
( |
const RWXmlName & |
name, |
|
|
RWXmlStreamElement * |
element, |
|
|
const std::list< std::pair< RWCString, RWXmlNamespace > > & |
namespaces |
|
) |
| |
This constructor takes a name for the element, an element value, and a list of namespaces. The parameter name contains a name for this element. The parameter element contains an element for the content of this element. The parameter namespaces holds a set of RWCString / RWXmlNamespace pairs.
This is a copy constructor. The parameter element contains the element to copy.
void RWXmlStreamElement::addAttribute |
( |
const RWXmlAttribute & |
attribute | ) |
|
Adds an attribute. The parameter attribute contains the attribute to add.
Adds an element to the set contained by this. The parameter element contains the element to add.
void RWXmlStreamElement::addNamespace |
( |
const RWCString & |
prefix, |
|
|
const RWXmlNamespace & |
fullname |
|
) |
| |
Adds a namespace to the set valid for this element. If the namespace is already present, this operation will replace it. The parameter prefix contains the namespace prefix (synonym). The parameter fullname contains the full namespace (prefix and URI).
void RWXmlStreamElement::deleteAttribute |
( |
const RWXmlName & |
name | ) |
|
Deletes an attribute. The parameter name contains the name of the attribute to be deleted.
void RWXmlStreamElement::deleteElement |
( |
const RWXmlName & |
name | ) |
|
Deletes an element from the set contained by this. Removes the first element with a matching name. The parameter name contains the name of the element to be deleted.
bool RWXmlStreamElement::deleteNamespace |
( |
const RWCString & |
prefix | ) |
|
Deletes an namespace from the set valid for this element. The parameter prefix contains the prefix of the namespace to be deleted.
RWCString RWXmlStreamElement::findAttribute |
( |
const RWXmlName & |
name | ) |
const |
Finds an attribute. The parameter name contains the name of the attribute to locate. Returns the value of the attribute, or RWCString() if none is found.
const_iterator RWXmlStreamElement::findElement |
( |
const RWXmlName & |
name | ) |
const |
Finds an element in the set contained by this. The parameter name contains the name of the element to locate. Returns the first element with a matching name.
const RWXmlNamespace RWXmlStreamElement::findNamespaceURI |
( |
const RWCString & |
prefix | ) |
const |
Finds the URI for a namespace. The parameter prefix contains the name of the namespace. Returns the URI for the namespace if present, otherwise returns RWCString().
const_iterator RWXmlStreamElement::findNextElement |
( |
const RWXmlName & |
name, |
|
|
const_iterator |
start |
|
) |
| const |
Finds an element in the set contained by this. The parameter name contains the name of the element to locate. The parameter start contains the iterator where the search starts. Returns the first element after start with a matching name.
const RWXmlAttributeSet& RWXmlStreamElement::getAttributes |
( |
| ) |
const |
|
inline |
Gets the element's attributes. Returns the set of attributes for this element.
Gets the set of sub-elements. Returns the set of elements contained in this element.
RWXmlName RWXmlStreamElement::getName |
( |
void |
| ) |
const |
|
inline |
Gets the element's name. Returns the name of this element.
const std::list<std::pair<RWCString, RWXmlNamespace> >& RWXmlStreamElement::getNamespaces |
( |
| ) |
const |
|
inline |
Gets the elements namespaces. Returns the set of namespaces active for this element.
RWCString RWXmlStreamElement::getValue |
( |
void |
| ) |
const |
|
inline |
Gets the element's value. Returns the value for this element.
void RWXmlStreamElement::resolveNamespaces |
( |
| ) |
|
Resolves the namespace URIs.
void RWXmlStreamElement::setName |
( |
const RWXmlName & |
name | ) |
|
|
inline |
Sets the element's name. The parameter name contains a name for this element.
void RWXmlStreamElement::setValue |
( |
const RWCString & |
value | ) |
|
|
inline |
Sets a value for the element.
Adds an element to the set contained by this. The parameter element contains the element to add.