[Tutor] Problems with creating XML-documents

bob gailer bgailer at gmail.com
Wed Apr 14 23:12:42 CEST 2010


On 4/14/2010 4:16 PM, Karjer Jdfjdf wrote:
> I'm having problems with creating XML-documents, because I don't seem 
> to write it to a document correctly. I have to write the document from 
> a loop:
>
>     doc.write('<?xml version="1.0" encoding="iso-8859-1"?>\n')
>     ....
>     for instance in query:
>         if doc != None:
>             text = str('<record id="' + str(instance.id)+ '">\n' + \
>                        ' <date>' +  str(instance.datetime) + ' 
> </date>\n' + \
>                        ' <order>'  + instance.order +  ' </order>\n' + \
>                        '</record>\n')
>             doc.write(text)
>
> When I try to parse it, it keeps giving errors.
>

I am frustrated with the lack of clarity and completeness. Please 
respect our time as volunteers by giving complete explicit informaion.

Show us the resultant file.

Tell us what parsing tool you are using.

Show us the exact errors.

[snip]

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100414/dba322c0/attachment-0001.html>


More information about the Tutor mailing list