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

Templater generates broken output file. #55

Closed
wants to merge 5 commits into from

Conversation

yoogeeks
Copy link

In my examples folder, I have a template named xml.docx, which contains a simple loop with a tag in it. Although Docxgen generates the output file with this template, it is broken. When I dug the output file, I found problem with document.xml. At many places, there were "</w:t></w:t>" instead of just one occurrence, which eventually causes the broken output. I believe (not sure) extra closing tag is added by handleRecursiveCase() method. After playing with the template testing with different forms of xmls, I found the problem occurs only with extra </w:t>(s) at multiple places. So without trying to change much of your code, I just scan through the xml generated, and replace double occurrence of </w:t> with single. If you have a better solution, go ahead.
P.S The template was initially generated by word, and hence, the problem may arise with other users as well.

@edi9999
Copy link
Member

edi9999 commented Jul 18, 2014

Ok, thanks, I will have a look

@tamagokun
Copy link
Contributor

I believe this is happening all over the place for me. Going to try this branch out.

@yoogeeks
Copy link
Author

Wait, I have just found that existence of two closing w:t tags isn't the only case. Sometimes, it misses some part of the xml as well. Working on a long term solution.

@yoogeeks yoogeeks closed this Jul 24, 2014
@yoogeeks
Copy link
Author

@edi9999 Can you provide me a quick heads up on which part of the code can generate a tag like <w:t xml:</w:t> ?

@edi9999
Copy link
Member

edi9999 commented Jul 24, 2014

The only class that deals with the templating is the XmlTemplater class

@yoogeeks
Copy link
Author

Yes, but I'm unable to pinpoint the part of this class or in what circumstances it generates a broken xml.

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

Successfully merging this pull request may close these issues.

None yet

4 participants