Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in generation: lxml.etree.XMLSyntaxError: Start tag expected, '<' not found #17

Open
Mark-Wellings opened this issue Jan 26, 2020 · 5 comments

Comments

@Mark-Wellings
Copy link

Hi,

I've been trying to get the 'generate_facturx_from_file' to work. Beforehand I validated my XML file and it's fine. When running the below unfortuntately, no succcess:

from facturx import generate_facturx_from_file
import os
thisdir = os.getcwd()
regular_pdf_invoice = str(thisdir + '\TEST

facturx_xml_file = str(thisdir + '\ZUGFeRD-invoice.xml')
facturx_pdf_invoice = generate_facturx_from_file(regular_pdf_invoice, facturx_xml_file)

The error I get is the following:

Traceback (most recent call last):
File "C:\Users\Mark\Desktop\factur-x.py", line 15, in <module>
facturx_pdf_invoice = generate_facturx_from_file(regular_pdf_invoice, facturx_xml_file)
File "C:\Users\Mark\AppData\Local\Programs\Python\Python37-32\lib\site-packages\facturx        \facturx.py", line 886, in generate_facturx_from_file
xml_root = etree.fromstring(xml_string)
File "src\lxml\etree.pyx", line 3234, in lxml.etree.fromstring
File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src\lxml\parser.pxi", line 1757, in lxml.etree._parseDoc
File "src\lxml\parser.pxi", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc
File "src\lxml\parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src\lxml\parser.pxi", line 711, in lxml.etree._handleParseResult
File "src\lxml\parser.pxi", line 640, in lxml.etree._raiseParseError
File "<string>", line 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

The files I use are attached (had to attach the xml as txt).
TEST.pdf

ZUGFeRD-invoice.txt

@schmidtkropp
Copy link

schmidtkropp commented Feb 28, 2020

hello everyone, I have the same mistake.
facturx-pdfgen tmp_splitpdfout / pdfout-GK24848-0021.pdf ZUGFeRD-invoice.xml zug.pdf
works
unfortunately it does not work from the script.

@hvbtup
Copy link

hvbtup commented Oct 5, 2020

Seems like a programming error in your code. You'll have to either double the backslash in your literal or use the r'\ZUGFeRD-invoice.xml' form.

@rockr79
Copy link

rockr79 commented Aug 16, 2024

Hello,
I have the same error message, does anyone have a solution yet?

@Andy87730
Copy link

I have the same problem...

@jonaswndl
Copy link

I have the same problem :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants