Results 1 to 2 of 2

Thread: [IceXML] How to operate XML document in ICE?

  1. #1
    JaneShang is offline Registered User
    Name: YuLiang, Shang
    Organization: Korea Advance Insitute of Science and Technology.
    Project: Human Robitics Remote Controller
    Join Date
    Apr 2005
    Posts
    14

    [IceXML] How to operate XML document in ICE?

    Dear Sir,

    Now I have an interface, something like: DispatchCommand(in XMLfile,out XMLfile), to dispatch command from client to server and return the result. The client would construct our system's command as XML file, and send to server, and then server would parse the XML file,and execute corresponding modules, finally, the result would also be packed into XML file.

    I review part of IceXML source code. It uses Expat to implement the key part: parse() function; however, it provides many interfaces, such as getParent(), getChild(), and wrappe into C++ class(IceXML). And my questions are:

    1: Does IceXML provide any interfaces to construct XML file rather than manually operate std::string? Interface like:
    CreateDocument(), InsertElement(), InsertAttribute(), etc...

    2: Does it support Chinese encoding,such as gb2312?

    3: The interfaces inside of IceXML is for internal use,such as IceStorm, or open for developer?

    4: Does IceXML fully wrappe all the interface inside of Expat or partially? If it fully wrapped, then we can only use IceXML instead of C-style of Expat function.

    5: Last, What's the limit for std::string? I mean the size limitation. I would save XML file into std::string or sequence<byte>. Which one would be better?

    Good luck!

    JaneShang

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Quote Originally Posted by JaneShang
    Dear Sir,

    Now I have an interface, something like: DispatchCommand(in XMLfile,out XMLfile), to dispatch command from client to server and return the result. The client would construct our system's command as XML file, and send to server, and then server would parse the XML file,and execute corresponding modules, finally, the result would also be packed into XML file.
    Just out of curiosity, why are you using XML to dispatch these commands? It seems to me that it would be much easier to define this in Slice directly . You would define interfaces with operations for each of your commands for example.

    Quote Originally Posted by JaneShang
    Dear Sir,
    1: Does IceXML provide any interfaces to construct XML file rather than manually operate std::string? Interface like:
    CreateDocument(), InsertElement(), InsertAttribute(), etc...
    No, it only supports functionality to parse an XML file. To create an XML string you could use IceUtil::XMLOutput (see Ice-2.1.1/include/IceUtil/OutputUtil.h).

    Quote Originally Posted by JaneShang
    2: Does it support Chinese encoding,such as gb2312?
    See the [http://www.jclark.com/xml/expatfaq.html Expat FAQ] for more information on the encodings supported by Expat.

    Quote Originally Posted by JaneShang
    3: The interfaces inside of IceXML is for internal use,such as IceStorm, or open for developer?
    No, it's not reserved for internal use, you can use it.

    Quote Originally Posted by JaneShang
    4: Does IceXML fully wrappe all the interface inside of Expat or partially? If it fully wrapped, then we can only use IceXML instead of C-style of Expat function.
    It partially wraps the expat library, it's mostly used by Ice services to parse XML configuration files.

    Quote Originally Posted by JaneShang
    5: Last, What's the limit for std::string? I mean the size limitation. I would save XML file into std::string or sequence<byte>. Which one would be better?
    Using a string is probably easier to transfer the XML. There's no limitations on the size of the string.

    Quote Originally Posted by JaneShang
    Good luck!

    JaneShang
    Let us know if you need more information!

    Benoit.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ICE with XML
    By arisen in forum Help Center
    Replies: 1
    Last Post: 11-18-2008, 02:05 PM
  2. ice api document
    By snowman in forum Help Center
    Replies: 0
    Last Post: 02-17-2008, 11:42 PM
  3. Memory leak in IceXML::Parser::parse(string&)
    By leya in forum Help Center
    Replies: 2
    Last Post: 11-29-2006, 10:24 PM
  4. confused with IceXML
    By Yunqiao Yin in forum Help Center
    Replies: 2
    Last Post: 08-28-2006, 11:21 PM
  5. Where's the chinese document of ICE.
    By siberian in forum Help Center
    Replies: 1
    Last Post: 05-11-2004, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •