Re: [libxml++] writing formatted (indented) files



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Vendredi 16 Mai 2003 10:06, Christophe de VIENNE a écrit :
> Le Vendredi 16 Mai 2003 08:46, Murray Cumming Comneon com a écrit :
> > > I made a few tests:
> > >
> > > Document::write_to_string() does not format the output
> > >
> > > Document::write_to_file() does format the ouput BUT if we use some
> > > Parser::parse_xx function before, it will not (and the ouput
> > > is different to
> > > the one of write_to_string()).
> > >
> > > So we have an inconsistent behavior anyway.
> >
> > I have added the examples/dom_read_write/ test in cvs and it does
> > demonstrate this obvious and serious problem - we are removing
> > significant white space. Christophe, I believe you have a solution for
> > this, but I'll try to take care of it if you want me to.
>
> The very first thing to do is, I think, not to use xmlSaveFormatFile, at
> least the way we do (I mean setting the 'format' parameter to 1 is bad).
> I'd prefer to use xmlSaveFile(), and add a member function
> save_to_format_file() to Document.
> If you agree with that (I guess you will) I'll commit it today.
>

I attached the output of your example when using xmlSaveFile(). If I remember 
well it's similar to what write_to_string produced in my first tests.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+xJ49B+sU3TyOQjARAvJ1AKDiWSY4S4cl9YTypV4CQBNQhyx8NwCfVN/X
8wNr5nj8PQvOF7/lQovDvwE=
=XISo
-----END PGP SIGNATURE-----
<?xml version="1.0"?>
<!DOCTYPE example PUBLIC "" "example.dtd">
<example><examplechild id="1"><child_of_child/></examplechild><examplechild id="2"><child_of_child/></examplechild></example>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]