Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

dxml_write_example.cpp

Go to the documentation of this file.
00001 
00009 # include "DataObject.h"
00010 # include "XMLStream.h"
00011 
00012 int main()
00013 {
00014   DataXML::DataObject d_fit, d_parameters, d_data, d_text ;
00015 
00016   d_fit.setName("fit");
00017   d_fit.setAttribute("version","1.0");
00018 
00019   int n = 3;
00020   
00021   d_parameters.setName("start");
00022   d_parameters.setAttribute("par_number", DataXML::to_string(n));
00023   
00024   for(int i=0; i<n; i++)
00025     {
00026       DataXML::DataObject d_var;
00027       
00028       d_var.setName(string("v") + DataXML::to_string(i));
00029       d_var.setAttribute("value", DataXML::to_string(1.5+i));
00030       
00031       d_parameters.appendChild(d_var);
00032     }
00033  
00034 
00035  
00036   d_fit.appendChild(d_parameters);
00037 
00038 
00039   d_fit.appendChildText("18735681359");
00040   d_fit.appendChildText("text bla bla bla");
00041   d_fit.appendChildText("xxxxxx"); 
00042  
00043   d_data.setName("data");
00044   d_data.setAttribute("annotations","VERBATIM_DATA");
00045   d_data.setAttribute("points", "VERBATIM_DATA");
00046   
00047   d_fit.appendChild(d_data);
00048 
00049   
00050 
00051 
00052   DataXML::OutputXMLStream xml_os(cout);
00053 
00054   xml_os.write(d_fit);
00055 
00056   return 0;
00057 }  
00058 

Generated at Tue Jan 28 15:35:28 2003 for DataXML by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001