Re: [xml] No Newlines at the end of a node

Daniel Veillard wrote:
On Wed, Jul 23, 2008 at 10:30:45AM +0200, Patrick Steiner wrote:
all works fine, but the output looks ugly. there are no newlines after a node. there is also no indent.

here is the output:

<?xml version="1.0" encoding="UTF-8"?>
<message time="20080722" type="0" number="664">foobar</message><message time="20080722" type="0" number="664">foobar</message></log>

any ideas how i can fix this? item 3

add the text nodes you want/need for formatting.
Libxml2 detected there was already text nodes as sibling of your new node
so it's a mixed content parent, and it won't create indentation nodes as a result.
Other option is to remove all the existing indentation nodes in
the document, in that case libxml2 automatic formatting may work.

hi daniel,

thanks for the infos, but if the xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>

it also doesntindent:

<?xml version="1.0" encoding="UTF-8"?>
<message time="20080722" type="0" number="664">foobar</message></log>


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