You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Marc Giger <gi...@gmx.ch> on 2006/11/27 22:07:00 UTC
[Axis2, Axiom] Serializing node to file
Hi
I have some troubles serializing a node and its subtree to a file.
I'm using the following code:
axiom_xml_writer_t *xml_writer = NULL;
axiom_output_t *om_output = NULL;
xml_writer = axiom_xml_writer_create(env, filename, "UTF-8", 0,0);
om_output = axiom_output_create(env, xml_writer);
AXIOM_NODE_SERIALIZE(node, env, om_output);
AXIOM_OUTPUT_FREE(om_output, env);
This should be almost the same as in the OM tutorial, no?
The problem with that is, that the files are written only partially.
Sometimes it creates a empty file, sometimes it writes 2/3 what it
should.
I should mention that I call the function multiple times with different
subnodes of the same document. Most of the time the first document is
empty and the second one contains a not finished xml stream.
E.g: <blablabla>buh buh buh<blabl
Additionally I see memory leaks within these calls:
I can report these in Jira if wished...
8,468 (80 direct, 8,388 indirect) bytes in 2 blocks are definitely lost
in loss record 23 of 59
==24537== at 0x400690F: malloc
(in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==24537== by 0x4C58FDB2: xmlNewTextWriter
(in /usr/lib/libxml2.so.2.6.26)
==24537== by 0x4C59002C: xmlNewTextWriterFilename
(in /usr/lib/libxml2.so.2.6.26)
==24537== by 0x4060022: axiom_xml_writer_create
(libxml2_writer_wrapper.c:370)
Btw: In the OM tutorial the function
axiom_xml_writer_create_for_file is listed which doesn't exist in the
sources. Shouldn't that be axiom_xml_writer_create as I used above?
Thanks
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org
Re: [Axis2, Axiom] Serializing node to file
Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Marc,
Marc Giger <gi...@gmx.ch> writes:
>
> Additionally I see memory leaks within these calls:
> I can report these in Jira if wished...
Yes Please ...
> Btw: In the OM tutorial the function
> axiom_xml_writer_create_for_file is listed which doesn't exist in the
> sources. Shouldn't that be axiom_xml_writer_create as I used above?
yes , It should be axiom_xml_writer_create as you pointed out.
thanks,
Dinesh
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org