XML Structure. More...
#include <rxmlstruct.h>
Public Member Functions | |
RXMLStruct (void) | |
RURI * | GetNamespace (const RString &xmlns) |
RCursor< RURI > | GetNamespaces (void) const |
RXMLTag * | GetTag (const RString &name) const |
RString | GetTagAttrValue (const RString &tag, const RString &attr) const |
RXMLTag * | GetTag (const RString &name, const RXMLTag *parent) const |
RString | GetTagAttrValue (const RString &tag, const RString &attr, const RXMLTag *parent) const |
void | AddTag (RXMLTag *parent, RXMLTag *tag) |
void | DeleteTag (RXMLTag *tag) |
void | InsertEntity (const RString &name, const RString &value) |
R::RCursor< RXMLAttr > | GetXMLEntitiesCursor (void) const |
void | SetVersion (const RString &version) |
RString | GetVersion (void) const |
void | SetEncoding (const RCString &encoding) |
RCString | GetEncoding (void) const |
void | SetDTD (const RString &dtd) |
RString | GetDTD (void) const |
virtual void | Clear (void) |
virtual bool | Compare (const RXMLTag *tag1, const RXMLTag *tag2) |
bool | Merge (const RXMLStruct &xml) |
virtual RXMLTag * | NewTag (const RString &tag, const RString &xmlns) |
virtual RXMLAttr * | NewAttr (const RString &name, const RString &value, const RString &xmlns) |
virtual RXMLAttr * | NewAttr (const RString &name, const RString &xmlns) |
virtual | ~RXMLStruct (void) |
Public Member Functions inherited from RTree< RXMLStruct, RXMLTag, true > | |
RTree (void) | |
void | ClearNode (RXMLTag *node) |
RXMLTag * | GetFirst (void) const |
RXMLTag * | GetLast (void) const |
size_t | GetMaxDepth (void) const |
RXMLTag * | GetTop (void) |
const RXMLTag * | GetTop (void) const |
size_t | GetNbNodes (void) const |
size_t | GetNbTopNodes (void) const |
size_t | GetTab (RXMLTag **tab, RXMLTag *node, bool children=false) |
void | InsertNode (RXMLTag *to, RXMLTag *node) |
void | DeleteNodes (RXMLTag *node, bool del=bAlloc) |
void | DeleteNode (RXMLTag *node, bool del=bAlloc) |
void | UpdateDepth (RXMLTag *node) |
void | MoveNode (RXMLTag *to, RXMLTag *node) |
void | Copy (const RTree< RXMLStruct, RXMLTag, a > &src) |
void | DeepCopy (RXMLTag *src, RXMLTag *newparent) |
RXMLTag * | GetNode (const TUse &tag) const |
double | GetUpOperationsCost (const RXMLTag *u, const RXMLTag *v) const |
virtual | ~RTree (void) |
Private Attributes | |
RContainer< RXMLAttr, true, true > | Entities |
RString | Version |
RCString | Encoding |
RString | DTD |
RContainer< RURI, true, true > | Namespaces |
Additional Inherited Members | |
Protected Attributes inherited from RTree< RXMLStruct, RXMLTag, true > | |
RXMLTag * | First |
RXMLTag * | Last |
size_t | NbTopNodes |
size_t | NbNodes |
size_t | MaxDepth |
Detailed Description
XML Structure.
This class provides a representation of a XML structure. It is implemented as a RTree of RXMLTag.
Constructor & Destructor Documentation
RXMLStruct | ( | void | ) |
Construct the XML Structure.
|
virtual |
Destruct the XML Structure.
Member Function Documentation
Get a pointer to a XML namespace.
- Parameters
-
xmlns Namespace.
Get a cursor over all XML namespaces used by this XML structure.
Find the first tag with a given name.
- Parameters
-
name Name of the tag to find.
- Returns
- a pointer to the tag of 0 if no tag exists.
Get the value of an attribute of the first tag with a given name. param tag Name of the tag. param attr Name of the attribute.
- Returns
- a string containing the value of the attribute or a null string if either the tag wasn't foud or the attribute was not found.
Find the first tag with a given name and a given parent.
- Parameters
-
name Name of the tag to find. parent Parent of the tag to find.
Get the value of an attribute of the first tag with a given name and a given parent.
- Parameters
-
tag Name of the tag. attr Name of the attribute. parent Parent of the tag to find.
- Returns
- a string containing the value of the attribute or a null string if either the tag wasn't foud or the attribute was not found.
Add a tag to the a given one which will be the parent. If the parent is null the tag is considered as the root tag in the XML structure.
- Parameters
-
parent The parent tag. tag The tag to add.
void DeleteTag | ( | RXMLTag * | tag | ) |
Delete a tag from the XML structure.
- Parameters
-
tag The tag to delete.
Insert an entity.
- Parameters
-
name Name of thae entity. value Value of thae entity.
R::RCursor<RXMLAttr> GetXMLEntitiesCursor | ( | void | ) | const |
Get a Cursor on the entities.
- Returns
- GXMLAttrCursor.
void SetVersion | ( | const RString & | version | ) |
Set the version of the XML standard.
- Parameters
-
version Version to assign.
void SetEncoding | ( | const RCString & | encoding | ) |
Set the encoding corresponding to the XML structure.
- Parameters
-
encoding Encoding to assign.
RCString GetEncoding | ( | void | ) | const |
Get the encoding corresponding to the XML structure.
- Returns
- RString.
void SetDTD | ( | const RString & | dtd | ) |
Set the DTD of the XML structure.
- Parameters
-
dtd DTD to assign.
|
virtual |
Clear the XML structure.
Reimplemented from RTree< RXMLStruct, RXMLTag, true >.
Compare two tags to see if it is the same tag. By default, the names must be the same, and that all common attributes have the same values.
- Parameters
-
tag1 First tag. tag2 Second tag.
bool Merge | ( | const RXMLStruct & | xml | ) |
Merge two xml structures.
- Parameters
-
xml XML structure to merge.
- Returns
- true if the merge could be done.
Create a new tag with a given name. By default, the method creates a RXMLTag.
- Parameters
-
tag Name of the tag. xmlns Namespace.
- Returns
- Pointer to a tag.
|
virtual |
Create a new attribute with a given name and value. By default, the method creates a RXMLAttr.
- Parameters
-
name Name of the attribute. value Value of the attribute. xmlns Namespace.
- Returns
- Pointer to a attribute.
Create a new attribute with a given name. By default, the method creates a RXMLAttr.
- Parameters
-
name Name of the attribute. xmlns Namespace.
- Returns
- Pointer to a attribute.
Field Documentation
|
private |
The entities of the structure.
|
private |
Version of the XML standard.
|
private |
Encoding of the corresponding XML file.
|
private |
URI of the DTD.
|
private |
All the namespaces used.