Re: how do i split an xml file using c++ (and the sax parser)



In your example it's just splitting an input stream into parts with
empty line separator.

For a more generic case, I think you will have to either process SAX
events, or serialize different DOM nodes.

vin b wrote:
> given a file such as
> <parent name="john">
> <child>a</child>
> <child>b</child>
> <child>c</child>
> </parent>
>
> <parent name="james">
> <child>a</child>
> </parent>
>
> <parent name="jim">
> <child>d</child>
> <child>a</child>
> </parent>
>
> , how would i split it, using c++ to 3 files corresponding to the
> <parent....> </parent> segments?
>
> thanks, vin

.