Re: Problem writing large XML file

2010-04-08 Thread Tobias
hi Vladimir,

Take a look at examples/SAXPrint/SAXPrintHandlers.cpp.

The SAXPrintHandlers class utilizes the XMLFormatter class to do the grunt work 
of escaping reserved chars, etc. by specifying certain formatting flags while 
writing. The SAXPrintHandlers contains a reference implementation for all SAX 
events. Maybe you can use the SAX interface of the class as your serialization 
interface.

It should be fast. Additionally you can use a buffered output (XMLFormatTarget) 
if the number of I/O ops is a bottleneck.


Tobias

  - Original Message - 
  From: Vladimir Loubenski 
  To: c-dev@xerces.apache.org 
  Sent: Monday, April 05, 2010 5:03 PM
  Subject: RE: Problem writing large XML file


  My own serialization procedure can be workaround. But this approach will
  require large amount of low level coding (writing xml tags, replacement
  for some characters, etc.) ... 
  Does exist some library that helps to implement such approach?
  Thank you in advance for any information.

  Regards,
  Vladimir. 

  -Original Message-
  From: Vitaly Prapirny [mailto:m...@mebius.net] 
  Sent: April 2, 2010 2:49 AM
  To: c-dev@xerces.apache.org
  Subject: Re: Problem writing large XML file

  Hi,

  Vladimir Loubenski wrote:
  > I have large amount of data (more than computer RAM) that I need to 
  > wrote to XML file.
  > How can I do that? It's not a problem for me to use another than DOM 
  > API but I can not find any. For example SAX only for reading.

  In most of the modern operating systems the memory a process can use is
  not bounded by RAM size.

  But if the data size is really huge (or for performance reasons) you
  could use you own serialization procedure instead of the DOM API.
  Traverse your data and write it out with xml tagging. And don't forget
  to replace some special characters with predefined entities like "<",
  ">", etc.

  Good luck!
  Vitaly

  -
  To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
  For additional commands, e-mail: c-dev-h...@xerces.apache.org


  -
  To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
  For additional commands, e-mail: c-dev-h...@xerces.apache.org

Re: Problem writing large XML file

2010-04-08 Thread Boris Kolpackov
Hi Vladimir,

Vladimir Loubenski  writes:

> I have large amount of data (more than computer RAM) that I need to
> wrote to XML file. How can I do that?

There is no out of the box support for this in Xerces-C++. What you
can do is create and serialize DOM fragments one at a time. In XSD[1]
we have an example called "streaming" (examples/cxx/tree/streaming/)
that shows how to do this.

[1] http://codesynthesis.com/products/xsd/

Boris

-- 
Boris Kolpackov, Code Synthesishttp://codesynthesis.com/~boris/blog
Open-source XML data binding for C++   http://codesynthesis.com/products/xsd
XML data binding for embedded systems  http://codesynthesis.com/products/xsde
Command line interface to C++ compiler http://codesynthesis.com/projects/cli

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Re: Problem writing large XML file

2010-04-08 Thread Vitaly Prapirny

In my opinion custom serializer requires a small amount of simple code
and more memory efficient in comparison with the code that use a
general purpose serializer such as the DOM API or something else.

Good luck!
Vitaly

Vladimir Loubenski wrote:

My own serialization procedure can be workaround. But this approach will
require large amount of low level coding (writing xml tags, replacement
for some characters, etc.) ...
Does exist some library that helps to implement such approach?
Thank you in advance for any information.

Regards,
Vladimir.

-Original Message-
From: Vitaly Prapirny [mailto:m...@mebius.net]
Sent: April 2, 2010 2:49 AM
To: c-dev@xerces.apache.org
Subject: Re: Problem writing large XML file

Hi,

Vladimir Loubenski wrote:

I have large amount of data (more than computer RAM) that I need to
wrote to XML file.
How can I do that? It's not a problem for me to use another than DOM
API but I can not find any. For example SAX only for reading.


In most of the modern operating systems the memory a process can use is
not bounded by RAM size.

But if the data size is really huge (or for performance reasons) you
could use you own serialization procedure instead of the DOM API.
Traverse your data and write it out with xml tagging. And don't forget
to replace some special characters with predefined entities like "<",
">", etc.

Good luck!
Vitaly

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org




-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



RE: Problem writing large XML file

2010-04-05 Thread Vladimir Loubenski
My own serialization procedure can be workaround. But this approach will
require large amount of low level coding (writing xml tags, replacement
for some characters, etc.) ... 
Does exist some library that helps to implement such approach?
Thank you in advance for any information.

Regards,
Vladimir. 

-Original Message-
From: Vitaly Prapirny [mailto:m...@mebius.net] 
Sent: April 2, 2010 2:49 AM
To: c-dev@xerces.apache.org
Subject: Re: Problem writing large XML file

Hi,

Vladimir Loubenski wrote:
> I have large amount of data (more than computer RAM) that I need to 
> wrote to XML file.
> How can I do that? It's not a problem for me to use another than DOM 
> API but I can not find any. For example SAX only for reading.

In most of the modern operating systems the memory a process can use is
not bounded by RAM size.

But if the data size is really huge (or for performance reasons) you
could use you own serialization procedure instead of the DOM API.
Traverse your data and write it out with xml tagging. And don't forget
to replace some special characters with predefined entities like "<",
">", etc.

Good luck!
Vitaly

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org


-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Re: Problem writing large XML file

2010-04-01 Thread Vitaly Prapirny

Hi,

Vladimir Loubenski wrote:

I have large amount of data (more than computer RAM) that I need to
wrote to XML file.
How can I do that? It's not a problem for me to use another than DOM API
but I can not find any. For example SAX only for reading.


In most of the modern operating systems the memory a process can use is
not bounded by RAM size.

But if the data size is really huge (or for performance reasons) you
could use you own serialization procedure instead of the DOM API.
Traverse your data and write it out with xml tagging. And don't forget
to replace some special characters with predefined entities like
"<", ">", etc.

Good luck!
Vitaly

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Problem writing large XML file

2010-04-01 Thread Vladimir Loubenski
 
Hello,
I have large amount of data (more than computer RAM) that I need to
wrote to XML file.
How can I do that? It's not a problem for me to use another than DOM API
but I can not find any. For example SAX only for reading. 

Regards,
Vladimir.

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org