Page 1 of 1

The XML data is invalid /word/header1.xml

PostPosted: Sun Apr 29, 2018 9:00 am
by danielepwp
hi,

I have a .docx template with some placeholders in the form of ${variable}.

I am getting this error after generating the final document from the template, when I try to open it in Word:

Screen Shot 2018-04-28 at 22.57.31.png
Screen Shot 2018-04-28 at 22.57.31.png (31.06 KiB) Viewed 1860 times


The XML data is invalid according to the schema.

Location: Part: /word/header1.xml, Line: 0, Column: 0

Word does not open and eventually crashes.

I attached a screenshot of the error and the document.

I am on version 3.3.7 of docx4j.

Could you help me please?

Thanks,
Daniele

Re: The XML data is invalid /word/header1.xml

PostPosted: Sun Apr 29, 2018 9:36 pm
by jason
header 1 contains mc:Ignorable="w14 w15 wp14 mv" but no namespace declaration for mv.

Could you please post the input docx?

Re: The XML data is invalid /word/header1.xml

PostPosted: Sun Apr 29, 2018 9:54 pm
by danielepwp
Hi Jason,

Thank you for your reply.

Attached is the input template as requested.

Many thanks,
Daniele

Re: The XML data is invalid /word/header1.xml

PostPosted: Sun Apr 29, 2018 11:06 pm
by danielepwp
Hi Jason,

It looks like the mv namespace is getting lost after the transformation:

xmlns:mv="urn:schemas-microsoft-com:mac:vml"

this is in the original template but it's not showing in the generated document.

Thanks,
Daniele

Re: The XML data is invalid /word/header1.xml

PostPosted: Mon Apr 30, 2018 9:30 am
by jason