Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-28-2006
Yunqiao Yin's Avatar
Yunqiao Yin Yunqiao Yin is offline
Registered User
 
Name: Yin Yunqiao
Organization: Baosteel
Project: real time process control system
 
Join Date: Jan 2004
Location: China
Posts: 56
Red face confused with IceXML

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;
   };

};
if the freeze map 's key is int, the value is :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>
and I write a xmltest.cpp to test the parser's output:
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;
}
But the output has many empty xml elements:
Code:
<>
<database>
<>


</>
<record>
<>

</>
<>


</>
<>

</>
<key>
<>
1
</>
</key>
<>

</>
<>


</>
<>

</>
<value>
<>

</>
<>


</>
<>

</>
<a>
<>
1
</>
</a>
<>

</>
<>


</>
<>

</>
<b>
<>
3.14
</>
</b>
<>

</>
<>


</>
<>

</>
<c>
<>
xml2db
</>
</c>
<>

</>
<>


</>
<>

</>
</value>
<>

</>
<>


</>
</record>
<>


</>
</database>
</>
If this is not a IceXML:ocumentBuilder's bug,then what's the IceXML real meaning?
__________________
Yunqiao Yin
Baosteel
real-time process control
ICE中文论坛http://lingdoo.just.as 欢迎大家捧场
Reply With Quote
  #2 (permalink)  
Old 08-28-2006
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
IceXML is only used internally by other Ice libraries and tools. It is not part of the official Ice API, and therefore also not documented in our Ice manual. I'm afraid providing assistance with undocumented internal libraries is out of the free support we can provide here in these forums.
Reply With Quote
  #3 (permalink)  
Old 08-29-2006
Yunqiao Yin's Avatar
Yunqiao Yin Yunqiao Yin is offline
Registered User
 
Name: Yin Yunqiao
Organization: Baosteel
Project: real time process control system
 
Join Date: Jan 2004
Location: China
Posts: 56
Quote:
Originally Posted by marc
IceXML is only used internally by other Ice libraries and tools. It is not part of the official Ice API, and therefore also not documented in our Ice manual. I'm afraid providing assistance with undocumented internal libraries is out of the free support we can provide here in these forums.
That's ok, . I just feel something strange with IceXML's behaviour.
__________________
Yunqiao Yin
Baosteel
real-time process control
ICE中文论坛http://lingdoo.just.as 欢迎大家捧场
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -4. The time now is 12:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.