[IceXML] How to operate XML document in ICE?

in Help Center
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
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
0
Comments
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
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).
See the [http://www.jclark.com/xml/expatfaq.html Expat FAQ] for more information on the encodings supported by Expat.
No, it's not reserved for internal use, you can use it.
It partially wraps the expat library, it's mostly used by Ice services to parse XML configuration files.
Using a string is probably easier to transfer the XML. There's no limitations on the size of the string.
Let us know if you need more information!
Benoit.