[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-xml-sig
Subject:    [XML-SIG] Re: DOM -> String ?
From:       fredrik () pythonware ! com (Fredrik Lundh)
Date:       2003-05-26 13:17:38
Message-ID: bat41q$748$1 () main ! gmane ! org
[Download RAW message or body]

Markus Jais wrote:

> but I still need a method to turn it into a string
> because I need a string for my programm. And I have to
> determine the length of the XML Document.

write it to a memory file before writing it to the socket:

http://www.python.org/doc/current/lib/module-StringIO.html

    import StringIO
    fp = StringIO.StringIO()
    Print(document, fp)
    s = fp.getvalue()

</F>





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic