Skip to content

Unmatched Template Error #8

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

Open
bkarst opened this issue Apr 20, 2014 · 5 comments
Open

Unmatched Template Error #8

bkarst opened this issue Apr 20, 2014 · 5 comments

Comments

@bkarst
Copy link

bkarst commented Apr 20, 2014

<w:p>
  <w:pPr>
    <w:pStyle w:val="Body 2"/>
    <w:bidi w:val="0"/>
  </w:pPr>
  <w:r>
    <w:t>#BEGIN_ROW:EXPERIENCES_TITLE#</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:pStyle w:val="Heading"/>
    <w:bidi w:val="0"/>
  </w:pPr>
  <w:r>
    <w:rPr>
      <w:rFonts w:ascii="Didot" w:cs="Arial Unicode MS" w:hAnsi="Arial Unicode MS" w:eastAsia="Arial Unicode MS"/>
      <w:rtl w:val="0"/>
    </w:rPr>
    <w:t>$EACH:EXPERIENCE_TITLE$</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:pStyle w:val="Body 2"/>
    <w:bidi w:val="0"/>
  </w:pPr>
  <w:r>
    <w:t>#END_ROW:EXPERIENCES_TITLE#</w:t>
  </w:r>
</w:p>

I'm zipping the following xml into a docx template. (I'm not posting the entire xml doc)

And I'm inserting the following data into the template:
{'experiences_title' => [{'experience_title' => "Experience"}}

It doesn't seem to recognize any of my row markers. When I try to generate the doc, I'm getting:

unmatched template markers: #BEGIN_ROW:EXPERIENCES_TITLE# nil: true, #END_ROW:EXPERIENCES_TITLE# nil: true. This could be because word broke up tags with it's own xml entries. See README.

@elliotwesoff
Copy link

I'm also getting this error. Is there a fix for this?

@rubymaniac2012
Copy link

I'm also getting the same error. Is it mandatory to loop inside the table? When I'm looping inside the table, it works fine but when I do the looping(#BEGIN_ROW:XXX# and #END_ROW:XXX#) without table, I'm getting the above error.

@elliotwesoff
Copy link

@nav0285 I came up with a fix for this. It causes the build to fail but it works for what I needed it to do. #13

@elliotwesoff
Copy link

elliotwesoff commented Jul 14, 2016

@nav0285,

My last comment has a link to the pull request, in which you can see the
code changes. The author has a "fail" statement when the array markers are
unmatched. I changed it so that rather than failing and raising error, it
just returns the XML at that point in the method.

@jawspeak
Copy link
Owner

jawspeak commented Jul 18, 2016

Happy to merge #13 if the tests are passing. ok to change the tests too based on this new behavior.

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

No branches or pull requests

4 participants