StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Illegal name character #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use the attached file, just run the following code, which does nothing but a 
NULL OP.
2. The docx is generated fine.  But failed to open in MS Word
3. The error says "Illegal name character".

The problems seems to have something to do with the "&" character
in the table header.  Remove that "&" and it works fine. 

Maybe there is something not right about how to handle the special
XML characters ???   And , converting the document to PDF will not
work either. 

Note that there is not even single variable  in the whole document, 
is it possible to mark up some sections of page to say "Leave this 
part alone (no parsing)"  ? it will make it easier for debugging - 
I can just markup some section of the document to see which part is 
causing problems.  Plus , it could be useful to leave some parts
of the document untouched (no parsing). 

===
//InputStream docx
IXDocReport report = XDocReportRegistry.getRegistry().loadReport(docx, T
emplateEngineKind.Velocity);
IContext context = report.createContext();
report.process(context, out);
===

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by quanqiu....@gmail.com on 30 Dec 2011 at 8:39

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

I have noticed this '&' character problem with another docx. The preprocessing 
step parse each XML entries with SAX parser  to build a custom DOM like to 
manage fields metadata, dynamic images etc. So this step must be done and you 
cannot avoid that.

>Note that there is not even single variable  in the whole document, 
>is it possible to mark up some sections of page to say "Leave this 
>part alone (no parsing)"
No it's not possible but I think it's not a good idea because it's difficult to 
set start/end section with for instance bookmark. Your problem with '&' 
characteris a bug and I will try to fix it.

>it will make it easier for debugging
You have right with this point and XDocReport process can be logged (just find 
time to finish that and explain that).

Regards Angelo

Original comment by angelo.z...@gmail.com on 31 Dec 2011 at 1:06

GoogleCodeExporter commented 8 years ago
Hi,

I have commited the fix Problem with '&' character in the Git repository and 
add a test case at 
http://code.google.com/p/xdocreport/source/browse/document/fr.opensagres.xdocrep
ort.document/src/test/java/fr/opensagres/xdocreport/document/preprocessor/sax/SA
XXDocPreprocessorTestCase.java (see testAMP).

XDocReport 0.9.4 will fix this problem.

Regards Angelo

Original comment by angelo.z...@gmail.com on 2 Jan 2012 at 12:06

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 19 Jan 2012 at 11:47