Closed GoogleCodeExporter closed 8 years ago
«$contact_name» is a mergefield? Please attach a simple Java+docx with your
problem.
Original comment by angelo.z...@gmail.com
on 27 Feb 2014 at 8:54
Hi Angelo, attaching the docs file and the Java sample class. Please let me
know if you need any details. Thanks in advance for your help.
Regards
Booshan
Original comment by booshan....@gmail.com
on 27 Feb 2014 at 4:43
Attachments:
Thank's for your attached docx+java. But I don't understand your problem, when
I generate the docx, I have "Dear John Doe"?
What is your problem?
Original comment by angelo.z...@gmail.com
on 27 Feb 2014 at 9:26
Hi Angelo, I am attaching the output file I am getting. I not sure how you are
getting "Dear John Doe". I am still getting "DearJohn Doe". You can also see
other variables without whitespace.
Original comment by booshan....@gmail.com
on 27 Feb 2014 at 9:39
Attachments:
I have compared your doc with my mine. In my document I have :
-----------------------------------------------------------------------
<w:p w:rsidR="008243F7" w:rsidRDefault="008243F7" w:rsidP="008243F7">
<w:pPr>
<w:pStyle w:val="NoSpacing" />
</w:pPr>
<w:r>
<w:t>Dear</w:t>
</w:r>
<w:r w:rsidR="00B172A0">
<w:t xml:space="preserve" />
</w:r>
<w:r>
<w:t xml:space="preserve" />
</w:r>
<w:r>
<w:rPr>
<w:noProof />
</w:rPr>
<w:t>John Doe</w:t>
</w:r>
<w:r>
<w:t>,</w:t>
</w:r>
</w:p>
---------------------------------------------------------------
In your document you have :
-----------------------------------------------------------------------
<w:p w:rsidR="008243F7" w:rsidRDefault="008243F7" w:rsidP="008243F7">
<w:pPr>
<w:pStyle w:val="NoSpacing" />
</w:pPr>
<w:r>
<w:t>Dear</w:t>
</w:r>
<w:r w:rsidR="00B172A0">
<w:t space="preserve" />
</w:r>
<w:r>
<w:t space="preserve" />
</w:r>
<w:r>
<w:rPr>
<w:noProof />
</w:rPr>
<w:t>John Doe</w:t>
</w:r>
<w:r>
<w:t>,</w:t>
</w:r>
</w:p>
---------------------------------------------------------------
Difference is about xml:space in my case and your case, you have just space
(that's why it deosn't preserve spaces).
It seems that it's a problem when your docx is loaded with SAX. Which OS do you
have?
Could you check which SAX Parser do you use?
Original comment by angelo.z...@gmail.com
on 27 Feb 2014 at 10:33
Hi Angelo, appreciate looking into this issue and thank you very much.
I am using Windows 7 Professional Pack -1, and running this using Java 1.7.
I am also seeing shani-xml-apis-1.4.17 downloaded by Maven. Please let me know
if you need any other details.
Regards
Booshan
Original comment by booshan....@gmail.com
on 27 Feb 2014 at 10:48
Hi Booshan,
I have attached 2 files. You must set it in your
com.swapstech.fxstar.document.service package. Launch the main of TestSAXSpace.
This main parse the document.xml (which contains xml:space) and display value
of this attribute. In my case my console displays :
---------------------------------------------------
URI : http://www.w3.org/XML/1998/namespace
QName : xml:space
LocalName : space
Value : preserve
---------------------------------------------------
I suppose that in your case QName will be "space" and not "xml:space". If it
that, could you investigate about this problem?
Many thank's.
Original comment by angelo.z...@gmail.com
on 28 Feb 2014 at 8:44
Attachments:
Hi Angelo, I see only document.xml attached. Can you please attach TestSAXSpace
as well?
Regards
Booshan
Original comment by booshan....@gmail.com
on 2 Mar 2014 at 1:24
ooops soory. here the TestSAXSpace .java
Original comment by angelo.z...@gmail.com
on 2 Mar 2014 at 10:35
Attachments:
Hi Angelo - you are correct. It was printing space instead of xml:space. It was
due to yahp converter that I was using to convert HTML to PDF. Thank you very
much for your help, and this works great now after removing these jars.
Best
Booshan
Original comment by booshan....@gmail.com
on 4 Mar 2014 at 1:15
Ok great. I close this issue.
Original comment by angelo.z...@gmail.com
on 4 Mar 2014 at 1:37
Original issue reported on code.google.com by
booshan....@gmail.com
on 27 Feb 2014 at 2:57