lxml XMLSyntaxError: how to convert to unicode?

kikomafija

New Member
I have a receiver function to parse an xml file. The contents of the xml file is something like this:\[code\]<?xml version "1.0" encoding = "UTF-8"?><Orders> <Order> <PO_Date>2011-04-08</PO_Date> <Customer_Name>SAM'S CLUBt</Customer_Name> </Order><Orders>\[/code\]When I do:\[code\]`node=etree.fromstring(contents)`\[/code\]I get the following error:\[code\]Exception Type: XMLSyntaxError at /receiver/Exception Value: expected '=', line 1, column 13\[/code\]How would I properly 'cleanse' the contents of the string such that I can create an lxml node here?
 
Back
Top