yanera_xml_input.h File Reference


Detailed Description

This file handles the loading into memory the XML input file. See the DTD and introduction for complete information on the XML tag semantics. Parsing the XML file requires libxml2 library.

Definition in file yanera_xml_input.h.

Go to the source code of this file.

Functions

void yanera_read_xml (yanera_container *yanera)
 Parses the XML root node.
void parseModelSection (xmlDocPtr xml_doc, xmlNodePtr xml_parent_node, yanera_container *yanera)
 Parses the <model_section/> node.
void parseModel (xmlDocPtr xml_doc, xmlNodePtr xml_node_model, yanera_model *model, yanera_container *yanera)
 Parses the <model/> node.
void parseLayer (xmlDocPtr xml_doc, xmlNodePtr xml_node_layer, yanera_layer *layer, yanera_container *yanera)
 Parses the <layer/> node.
void parseRepeat (xmlDocPtr xml_doc, xmlNodePtr xml_node_parent, unsigned short repeat_number, yanera_model *model, yanera_container *yanera)
 Parses a <repeat/> node.
void parseDataSection (xmlDocPtr xml_doc, xmlNodePtr xml_node_parent, yanera_container *yanera)
 Parses the <data_section/>.
void parseData (xmlDocPtr xml_doc, xmlNodePtr xml_node_parent, yanera_data *data)
 Parses a <data/> node.
void parseResolution (xmlDocPtr xml_doc, xmlNodePtr xml_node_data, yanera_data *data)
 Parses a <resolution/> node.
void parseMiscellaneousSection (xmlDocPtr xml_doc, xmlNodePtr xml_parent_node, yanera_container *yanera)
 Parses a <miscellaneous_section/> node.
void parseMinMax (xmlDocPtr xml_doc, xmlNodePtr xml_node_parent, unsigned short index, yanera_container *yanera)
 Parses <min//> nodes.


Function Documentation

void yanera_read_xml ( yanera_container yanera  ) 

Parameters:
[in] filename The XML input file name
yanera A newly allocated yanera_container that will hold the data in memory.
This function handles the root node. It also performs validation agains the DTD. Children of the root node are:
  • <data_section/>
  • <model_section/>

Definition at line 27 of file yanera_xml_input.c.

void parseModelSection ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_parent_node,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_parent_node In this case the <model_section/> of the XML DOM.
yanera The yanera_container that holds the data in memory.
Children of the <model_section/> node are:
  • <model_type/>
  • <model/>
  • <component/>

Definition at line 108 of file yanera_xml_input.c.

void parseModel ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_model,
yanera_model model,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_model The <model_section/> node of the XML DOM.
model A newly allocated yanera_model that will hold the data.
yanera The yanera_container that holds the data in memory.
The <model/> node will form the model in memory, so the purpose of the yanera variable is access to the yanera_parameters. The model has already been linked into the list of models in yanera.

Children of the <model/> node are:

  • <polarized/>
  • <name/>
  • <bulk/>
  • <layer/>
  • <repeat/>
  • <substrate/>
  • <background/>

Definition at line 195 of file yanera_xml_input.c.

void parseLayer ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_layer,
yanera_layer layer,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_layer This can either be a <layer/> node or a <repeat/> node.
layer A newly allocated yanera_layer that will hold the data.
yanera The yanera_container that holds the data in memory.
The <layer/> node will form the layer in memory, so the purpose of the yanera variable is access to the yanera_parameters. The layer has already been linked into the list of layers in the appropriate model.

Possible children of the <layer/> node are:

  • <type/>
  • <name/>
  • <func/>
  • <parm/>
  • <thik/>
  • <sigz/>
  • <cntr/>
  • <rsld/>
  • <isld/>
  • <rmag/>
  • <include/>

Definition at line 312 of file yanera_xml_input.c.

void parseRepeat ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_parent,
unsigned short  repeat_number,
yanera_model model,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_parent In this case a <model/> node of the XML DOM.
[in] repeat_number A property of the <repeat/> node indicating the number of types the groupd of layers should be repeated.
model A newly allocated yanera_model that will hold the data.
yanera The yanera_container that holds the data in memory.
The function uses a temporary model to hold a copy of the repeating group of layers. It then copies that group into the model the correct number of times.

Children of the <repeat/> node are:

  • <layer/>

Definition at line 690 of file yanera_xml_input.c.

void parseDataSection ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_parent,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_parent In this case the node of the XML DOM.
yanera The yanera_container that holds the data in memory.
This function does very little at this point. Later versions will load the data into memory.

Children of the <data_section/> node are:

  • <data/>

Definition at line 785 of file yanera_xml_input.c.

void parseData ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_parent,
yanera_data data 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_parent In this case a <data_section/> node of the XML DOM.
data A newly allcoated yanera_data that holds the data in memory.
This function does very little at this point. Later versions will load the data into memory.

Children of the <data/> node are:

  • <filename/>
  • <resolution/>

Definition at line 816 of file yanera_xml_input.c.

void parseResolution ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_data,
yanera_data data 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_data A <data/> node of the XML DOM.
data A newly allcoated yanera_data that holds the data in memory.
This function does very little at this point. It will determine the type of resolution function to apply to the reflectivity calculation.

Children of the <data/> node are:

  • <type/>

Definition at line 849 of file yanera_xml_input.c.

void parseMiscellaneousSection ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_parent_node,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_parent_node In this case the <miscellaneous_section/> of the XML DOM.
yanera The yanera_container that holds the data in memory.
This function reads miscellaneous information from the <miscellaneous_section/>

Children of the <miscellaneous_section/> node are:

  • <write_results/>
  • <write_profile/>
  • <write_reflectivity/>
  • <write_slabs/>
  • <do_fit/>
  • <q_min/>
  • <q_max/>
  • <q_num/>
  • <quadrature_error/>

Definition at line 927 of file yanera_xml_input.c.

void parseMinMax ( xmlDocPtr  xml_doc,
xmlNodePtr  xml_node_parent,
unsigned short  index,
yanera_container yanera 
)

Parameters:
[in] xml_doc The XML document structure.
[in] xml_node_parent In this case the parameter node currently being read.
index The array index of the parameter currently being read.
yanera The yanera_container that holds the data in memory.
This function reads minimum and maximum constraints of a parameter

Definition at line 1215 of file yanera_xml_input.c.


Generated on Thu May 29 10:56:33 2008 by  doxygen 1.5.5