thuliobuarque / java2word

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

Unable to enclose paragraph content within "<" ">" (angle brackets) #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Leonardo, It's easy to post issues, I understand (as I too am a developer) & 
it's difficult to fix them. Having said that, I just couldn't help bringing out 
this trivial issue.

I downloaded j2w-ejb-2.0.zip from your site. Am using it to develop an Eclipse 
plug-in for my use. Am using Windows XP & MS Word 2007 version. 

What steps will reproduce the problem?
1. Am trying to add a para in my doc (i.e. the doc generated through code using 
the following code snippet):
myDoc.addEle(
    Paragraph.with(
        "<The applicability of the each area depends on the project influencing factors>").create());

2. I added this line to my code (which genearates the doc & ran the app.
3. The Word doc got generated, but I couldn't open the file. On trying to open 
it, I got a pop-up message saying "Some XML elements in the Word doc are 
invalid".
4. I then went back to the code & removed the "<" & ">" (angle brackets) & it 
works fine now.

So the issue seems to be with using "<", ">" in the paragraph content.

Can you kindly look at this issue?

Original issue reported on code.google.com by TheRhyth...@gmail.com on 12 Jan 2012 at 7:22

GoogleCodeExporter commented 8 years ago
if you use the escape the special characters you can avoid this problem.

like for '<' symbol u can use > and for '>' symbol '>'

myDoc.addEle(Paragraph.with("<The applicability of the each area depends on the 
 project influencing factors>").create());

try it will work...

Original comment by juturuna...@gmail.com on 18 Jan 2012 at 6:18

GoogleCodeExporter commented 8 years ago
thanks a lot juturunavatha. I created a method on Utils.java to replace some 
special characters with the Unicode Code in decimal... it still in progress... 
I committed the code but haven't published in a Jar file yet. 

I will add the answer to this page later: 
http://code.google.com/p/java2word/wiki/EncodingTipsandTricks  

Original comment by leonardo...@gmail.com on 18 Jan 2012 at 7:01