mfenner / pandoc-jats

A Lua custom writer for Pandoc generating JATS XML
GNU General Public License v2.0
74 stars 19 forks source link

Example generates unterminated <funding-group> tag #2

Closed egh closed 9 years ago

egh commented 10 years ago
❤ pandoc examples/example1.md --filter pandoc-citeproc -t JATS.lua -o example1.xml
❤ xmllint example1.xml 
example1.xml:64: parser error : Opening and ending tag mismatch: funding-group line 63 and article-meta
    </article-meta>
                   ^
example1.xml:65: parser error : Opening and ending tag mismatch: article-meta line 21 and front
  </front>
          ^
example1.xml:380: parser error : Opening and ending tag mismatch: front line 5 and article
</article>
          ^
example1.xml:380: parser error : Premature end of data in tag article line 4
</article>
mfenner commented 10 years ago

This problem is related to parsing the template default.jats and properly handling missing funding-statement information. I will look into this.

I have also just started to rewrite the JATS write in Haskell, but that may take 2-3 months, as it is a side project.

egh commented 10 years ago

thanks, Martin.

I've got to say that lua was easier for me to get working than compiling the haskell would be :)

mfenner commented 10 years ago

Yes, but I ran into a few limitations with Lua, one of them probably related to the error you are seeing.

egh commented 10 years ago

Actually, this looks like it's just a problem with the default.jats template: there is an extra unclosed <funding-group> tag.

I'm just speaking from an end user perspective that with lua embedded in pandoc it's remarkably easy to use. As a language it may be difficult to work with.

Thanks for your reply.

mfenner commented 10 years ago

The problem with how Lua is implemented here (embedded into Pandoc) is that support for Pandoc templates is a hack, and that there are edge cases that can break this - nested if/then conditions in this case. I need to check whether Pandoc templates support has improved since I wrote this 6 months ago. I will see whether I can work around this as a quick fix, but there are other reasons to move to Haskell in the long run.

mfenner commented 9 years ago

Fixed default.jats, and using Pandoc to parse the template instead of doing this in the custom writer.

egh commented 9 years ago

Thanks!