meTypeset icon indicating copy to clipboard operation
meTypeset copied to clipboard

lxml.etree.XMLSyntaxError: StartTag: invalid element name

Open juanCure opened this issue 6 years ago • 3 comments

I have run the following command:

meTypeset.py docx foo.docx output/foo1 --nogit --debug --interactive --zotero

I have added meTypeset to my PATH environment variable and I have configured the settings.xml file to points to a local zotero database, the process of conversion starts and pass through for some stages until the [libZotero] stage and I have got the following message of error:

Traceback (most recent call last):
  File "/usr/local/meTypeset/bin/meTypeset.py", line 256, in <module>
    main()
  File "/usr/local/meTypeset/bin/meTypeset.py", line 252, in main
    me_typeset_instance.run()
  File "/usr/local/meTypeset/bin/meTypeset.py", line 244, in run
    self.run_modules()
  File "/usr/local/meTypeset/bin/meTypeset.py", line 228, in run_modules
    BibliographyDatabase(self.gv).run()
  File "/usr/local/meTypeset/bin/bibliographydatabase.py", line 422, in run
    self.process_zotero()
  File "/usr/local/meTypeset/bin/bibliographydatabase.py", line 403, in process_zotero
    ref = etree.fromstring(res)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:82934)
  File "src/lxml/parser.pxi", line 1819, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:124533)
  File "src/lxml/parser.pxi", line 1700, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:122964)
  File "src/lxml/parser.pxi", line 1040, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:116705)
  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:110510)
  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:112276)
  File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:111124)
lxml.etree.XMLSyntaxError: StartTag: invalid element name, line 1, column 731

Although the process ends with the previous message, in the output directory there are some directories, In the nlm directory there is 2 resulting files JATS/XML, however the references appear as

<ref id="ID9d6e3ba7-aa77-491b-a934-8d085a821b80">Alaniz-&#193;lvarez, S.A., Nieto-Samaniego, A.F., Reyes-Zaragoza, M.A., Ojeda-Garc&#237;a, A.C., Orozco-Esquivel, M.T., Vasallo, L.F., 2001, Estratigraf&#237;a y deformaci&#243;n extensional en la regi&#243;n San Miguel de Allende-Quer&#233;taro, M&#233;xico: Revista Mexicana de Ciencias Geol&#243;gicas, 18, 129-148. </ref> However I need the references as appear below , because I am using elifesciences / lens to display the resulting NLM xml file:

<ref id="ID9d6e3ba7-aa77-491b-a934-8d085a821b80">
  <element-citation publication-type="journal">
    <person-group person-group-type="author">
      <name>
        <surname>Alaniz-Álvarez</surname>
        <given-names>A</given-names>
      </name>
      <name>
        <surname>Nieto-Samaniego</surname>
        <given-names>A.F.</given-names>
      </name>
      <name>
        <surname>Reyes-Zaragoza</surname>
        <given-names>M.A.</given-names>
      </name>
      <name>
        <surname>Ojeda-García</surname>
        <given-names>A.C.</given-names>
      </name>
      <name>
        <surname>Orozco-Esquivel</surname>
        <given-names>M.T.</given-names>
      </name>
      <name>
        <surname>Vasallo</surname>
        <given-names>L.F.</given-names>
      </name>
    </person-group>
    <article-title>Estratigrafía y deformación extensional en la región San Miguel de Allende-Querétaro, México</article-title>
    <source>Revista Mexicana de Ciencias Geológicas</source>
    <date>
      <year>2001</year>
    </date>
    <volume>18</volume>
    <issue></issue>
    <fpage>129</fpage>
    <lpage>148</lpage>
  </element-citation>
</ref>

Someone knows how to resolve this trouble?

Best regards juanCure

juanCure avatar Mar 29 '18 02:03 juanCure

Thanks for this.

Could you please provide:

  1. The document on which you are working and that causes this error.

  2. The Zotero database.

Many thanks.

On 29/03/18 03:11, Juan Manuel Rodríguez Martínez wrote:

I have run the following command:

|meTypeset.py docx foo.docx output/foo1 --nogit --debug --interactive --zotero|

I have added meTypeset to my PATH environment variable and I have configured the settings.xml file to points to a local zotero database, the process of conversion starts and pass through for some stages until the [libZotero] stage and I have got the following message of error:

|Traceback (most recent call last): File "/usr/local/meTypeset/bin/meTypeset.py", line 256, in main() File "/usr/local/meTypeset/bin/meTypeset.py", line 252, in main me_typeset_instance.run() File "/usr/local/meTypeset/bin/meTypeset.py", line 244, in run self.run_modules() File "/usr/local/meTypeset/bin/meTypeset.py", line 228, in run_modules BibliographyDatabase(self.gv).run() File "/usr/local/meTypeset/bin/bibliographydatabase.py", line 422, in run self.process_zotero() File "/usr/local/meTypeset/bin/bibliographydatabase.py", line 403, in process_zotero ref = etree.fromstring(res) File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:82934) File "src/lxml/parser.pxi", line 1819, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:124533) File "src/lxml/parser.pxi", line 1700, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:122964) File "src/lxml/parser.pxi", line 1040, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:116705) File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:110510) File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:112276) File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:111124) lxml.etree.XMLSyntaxError: StartTag: invalid element name, line 1, column 731 |

Although the process ends with the previous message, in the output directory there are some directories, In the nlm directory there is 2 resulting files JATS/XML, however the references appear as

|Alaniz-Álvarez, S.A., Nieto-Samaniego, A.F., Reyes-Zaragoza, M.A., Ojeda-García, A.C., Orozco-Esquivel, M.T., Vasallo, L.F., 2001, Estratigrafía y deformación extensional en la región San Miguel de Allende-Querétaro, México: Revista Mexicana de Ciencias Geológicas, 18, 129-148. | However I need the references as appear below , because I am using elifesciences / lens to display the resulting NLM xml file:

| Alaniz-Álvarez A Nieto-Samaniego A.F. Reyes-Zaragoza M.A. Ojeda-García A.C. Orozco-Esquivel M.T. Vasallo L.F. Estratigrafía y deformación extensional en la región San Miguel de Allende-Querétaro, México Revista Mexicana de Ciencias Geológicas 2001 18 129 148 |

Someone knows how to resolve this trouble?

Best regards juanCure

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MartinPaulEve/meTypeset/issues/121, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_ot7l5WpKmWrle3tbNGfx3VTA6ft0jks5tjELggaJpZM4S_opQ.

-- Professor Martin Paul Eve Chair of Literature, Technology and Publishing Birkbeck, University of London

T: 0203 073 8420 E: [email protected] W: https://www.martineve.com R: 416, 43 Gordon Square, London, WC1H 0PD

Books: https://www.martineve.com/books/ Articles: https://www.martineve.com/c-v/

Series Editor: New Horizons in Contemporary Writing (Bloomsbury) Director, Birkbeck Centre for Technology and Publishing Founder, Open Library of the Humanities (https://www.openlibhums.org) Chief Editor, Orbit (https://www.pynchon.net) Senior Online Editor, Alluvium, (http://www.alluvium-journal.org)

MartinPaulEve avatar Mar 29 '18 07:03 MartinPaulEve

Hi @MartinPaulEve

Thanks a lot for your response. I send what you required through mail.

juanCure avatar Mar 30 '18 02:03 juanCure

@juanCure did you solve this. could you please explain how you solved it and what was wrong

sikander27 avatar Jun 03 '21 15:06 sikander27