|
|
|
||||||
|
I'm working on a xml2freezedb module,which read xml data from a xml file,and write them into freeze evictor or map db.
for example,if the slice: Code:
module Demo
{
struct hello
{
int a;
float b;
string c;
};
};
emo::hello then the xml file will like this:Code:
<database>
<record>
<key>1</key>
<value>
<a>1</a>
<b>3.14</b>
<c>xml2db</c>
</value>
</record>
</database>
Code:
#include <IceXML/Parser.h>
#include <iostream>
using namespace std;
using namespace IceXML;
void dumpXML(NodePtr node)
{
cout << "<" << node->getName() << ">" << endl;
NodeList nodes = node->getChildren();
if( nodes.empty() )
{
cout << node->getValue() << endl;
}
else
{
for(int i = 0;i < nodes.size() ;i++)
{
dumpXML(nodes[i]);
}
}
cout << "</" << node->getName() << ">" << endl;
}
int main(int argc,char** argv)
{
DocumentPtr xml = IceXML::Parser::parse(argv[1]);
dumpXML(xml);
return 0;
}
Code:
<> <database> <> </> <record> <> </> <> </> <> </> <key> <> 1 </> </key> <> </> <> </> <> </> <value> <> </> <> </> <> </> <a> <> 1 </> </a> <> </> <> </> <> </> <b> <> 3.14 </> </b> <> </> <> </> <> </> <c> <> xml2db </> </c> <> </> <> </> <> </> </value> <> </> <> </> </record> <> </> </database> </> ocumentBuilder's bug,then what's the IceXML real meaning?
__________________
Yunqiao Yin Baosteel real-time process control ICE中文论坛http://lingdoo.just.as 欢迎大家捧场 |
|
||||||
|
Quote:
. I just feel something strange with IceXML's behaviour.
__________________
Yunqiao Yin Baosteel real-time process control ICE中文论坛http://lingdoo.just.as 欢迎大家捧场 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Memory leak in IceXML::Parser::parse(string&) | leya | Help Center | 2 | 11-29-2006 11:24 PM |
| :confused: How to use Ice with other platform on windows, such as Dev-C++, C++Builder | rocshaw | Help Center | 3 | 11-24-2005 03:48 AM |
| Confused with IcePack demos | Yunqiao Yin | Help Center | 1 | 09-04-2005 08:58 PM |
| Confused with IcePack | amrufon | Help Center | 7 | 06-10-2005 12:35 AM |
| [IceXML] How to operate XML document in ICE? | JaneShang | Help Center | 1 | 05-18-2005 07:31 AM |