Como puedo hacer para que no me de este error?
conversor.xsl:1: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0"?>
^
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home_1/f/f3294242/Projecte2/tasca13.py", line 11, in <module>
print llegir_conversor('conversor.xsl')
File "/home_1/f/f3294242/Projecte2/tasca13.py", line 7, in llegir_conversor
doc= libxml2.parseFile(conversor)
File "/var/lib/python-support/python2.5/libxml2.py", line 1279, in parseFile
if ret is None:raise parserError('xmlParseFile() failed')
libxml2.parserError: xmlParseFile() failed
Código PHP:
import libxml2
def llegir_conversor(conversor):
doc= libxml2.parseFile(conversor)
a= libxml2.parseStylesheetDoc(doc)
b= libxml2.applyStylesheet(a)
print b
print llegir_conversor('conversor.xsl')