cXmlReader & cXmlWriter classes provides xml handling in CONTENIDO. This classes should be used for all xml read and write purposes in CONTENIDO.
The reader class should be used for all read only xml operations.
Just create cXmlReader instance and call loadXML or load methods(see code below).
The difference in this methods is simple. The load method loads xml from file and loadXML loads xml from given string.
cXmlReader class provides also some helpful xpath methods.
The writer class should be used for all write XML operations. Just create a
By default is the XML version 1.0 and encoding UTF-8. If you want to use another XML version or encoding, then you may specify these in the constructor.
After creation of writer object you can call
addElement method. This method adds new node to the created XML document. First parameter is the name of the node element. This parameter is obligatory, all other parameters are optional.
After creation and adding of elements to the created XML file, you can save it. For saving purposes you can use two different functions,
saveToString method returns whole XML file as string and
saveToFile method gives you possibility to save xml as file in the directory on the file system.