junk after document element: line 13, column 2

boomefalo

New Member
while parsing xml file,i am getting the following traceback\[code\]ParseError at /addxml/junk after document element: line 13, column 2Request Method: POSTRequest URL: http://localhost:8000/addxml/Django Version: 1.3.7Exception Type: ParseErrorException Value: junk after document element: line 13, column 2Exception Location: /root/Samples/DemoApp/DemoApp/views.py in addxml, line 98Python Executable: /usr/bin/python\[/code\]This is my code\[code\]if request.POST: path = "{0}/app_name/filename.xml".format(settings.PROJECT_ROOT) xmlDoc = open(path, 'r') xmlDocData = http://stackoverflow.com/questions/15837529/xmlDoc.read() xmlDocTree = etree.XML(xmlDocData)\[/code\]below line is giving the error\[code\]xmlDocTree = etree.XML(xmlDocData)<book> <book_id>101</book_id> <book_name>Python</book_name> <publisher_name>Maxwell</publisher_name> <author_id>1002</author_id> <first_name>John</first_name> <last_name>Dezosa</last_name> <email>[email protected]</email> <age>34</age> </book> <book> <book_id>102</book_id> <book_name>Django</book_name> <publisher_name>Technical</publisher_name> <author_id>1003</author_id> <first_name>Josep</first_name> <last_name>Raj</last_name> <email>[email protected]</email> <age>29</age> </book> \[/code\]Thanks
 
Back
Top