Re: [xml] XML Formatting
- From: Daniel Veillard <veillard redhat com>
- To: Alistair Leslie-Hughes <leslie_alistair hotmail com>
- Cc: xml gnome org
- Subject: Re: [xml] XML Formatting
- Date: Wed, 9 Jul 2008 05:22:45 -0400
On Wed, Jul 09, 2008 at 06:44:38PM +1000, Alistair Leslie-Hughes wrote:
I have a xml document as follows
<Testing>\n<Val foo=\"baa\">xxx </Val></Testing>
Note the \n after <Testing>.
If I load and then save using libxml, the formating appears to be lost.
I've used xmlNodeDump with format to 1 and xmlTreeIndentString="\t", and
yes it indents, but thew whole document.
MSXML3 only formats the places that have a \n, in the example above it
would changed the \n -> \r\n\t.
1.Is there a way to reproduce this bahaviour?
2. Is there a way to normalize EOL's to \r\n?
no it doesn't make any sense from an XML processing perspective as
this will be changed back when parsing.
doing this does not make sense from an XML perspective, if you want to change
it, post-process the XML document.
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
] [Thread Prev