[XML-SIG] [ pyxml-Bugs-1352653 ] Pretty printing not working

SourceForge.net noreply at sourceforge.net
Thu Nov 10 00:10:17 CET 2005


Bugs item #1352653, was opened at 2005-11-09 23:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1352653&group_id=6473

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Fabian Sturm (sturmf)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pretty printing not working

Initial Comment:
Hi!

I try to get pretty printing working with xml.sax.writer.
Unfortunately I failed.

this is teh code I used:

#!/usr/bin/python

import sys
import string
import xml.sax.writer

d = 'somthing'

w = xml.sax.writer.PrettyPrinter(sys.stdout)

w.startDocument()

w.startElement('test', {})

w.startElement('test2', {})
w.characters(d, 0, len(d))
w.endElement('test2')

w.endElement('test')


w.endDocument()

The output is:
<?xml version="1.0" encoding="iso-8859-1"?>
<test><test2>somthing</test2></test>

and the expected output is (or similar):
<?xml version="1.0" encoding="iso-8859-1"?>
<test>
  <test2>somthing</test2>
</test>

Any help would be great!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1352653&group_id=6473


More information about the XML-SIG mailing list