Steve Holden <[EMAIL PROTECTED]> writes: > Diez B. Roggisch wrote: > > Ricardo Aráoz schrieb: > >> doc = """ > >> <?xml version="1.0"?> > > > > It's not allowed to have a newline before the <?xml ...> > > > > Put it on the line above, and things will work. > > > If you don't think that looks pretty enough just escape the first > newline in the string constant to have the parser ignore it:
Quite apart from a human thinking it's pretty or not pretty, it's *not valid XML* if the XML declaration isn't immediately at the start of the document <URL:http://www.w3.org/TR/xml/#sec-prolog-dtd>. Many XML parsers will (correctly) reject such a document. > doc = """\ > <?xml version="1.0"?> This is fine. -- \ "True greatness is measured by how much freedom you give to | `\ others, not by how much you can coerce others to do what you | _o__) want." —Larry Wall | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list