PROFASI  Version 1.5
Classes | Functions
ProFASi XML module
Utilities

Basic XML parsing for ProFASi. More...

Collaboration diagram for ProFASi XML module:

Classes

class  prf_xml::XML_Node
 A class to represent an XML node. More...
 
class  prf_xml::Chunk
 A "chunk" of data in an XML file. More...
 
class  prf_xml::XML_Mini
 A small class to do the book keeping for XML parsing. More...
 

Functions

XML_Nodeprf_xml::get_xml_tree (std::string xml_file_name)
 A function returning an XML tree taking an XML file name.
 

Detailed Description

The namespace prf_xml is a collection of classes and functions meant to provide basic support for parsing XML in ProFASi. It is not meant to be a comprehensive XML parser module. There are more established tools for doing such things. The purpose of this module is to provide the minimal functionality that is required in ProFASi while still keeping the package self contained.

One non-trivial feature of this module is its ability to autogenerate XML nodes using a given template. See the documentation of prf_xml::XML_Node::interpret_formatted_data() for details.

In this preliminary version, special XML tags such as <?xml ...?> and DOCTYPE declarations are collected, but then ignored. In the future the module may be extended, upon necessity, to process such tags.

An XML tree is made of inter-related XML nodes. Each node has a name, some "attributes", and possibly, one or more "child nodes". A tree has to contain one and only one "root" node. Every other node in the tree can be reached by starting from the root node and recursively browsing the child nodes.

Function Documentation

XML_Node * prf_xml::get_xml_tree ( std::string  xml_file_name)

This is probably how this module will most often be used. You have an XML file. Pass it to this function and get a pointer to the root node of the XML tree in that file. A lot of things happen in between, such as syntax checking of the XML tags, but such things are normally not of interest to the outside world. Either the file parses nicely into an XML tree or it does not. In case of errors, the returned pointer will be NULL.

A little note on memory management: this function allocates memory as needed for the root and the child XML nodes. It is the responsibility of the outside program to destroy the newly allocated node by calling delete on it.

See Also
XML_Node

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2