Skip to content

Error while converting enex files under Ubuntu #9

Open

Description

@arguser
/usr/lib/ruby/2.3.0/rexml/parsers/baseparser.rb:362:in `pull_event': Declarations can only occur in the doctype declaration. (REXML::ParseException)
Line: 1
Position: 2815
Last 80 unconsumed characters:
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><ol><li
        from /usr/lib/ruby/2.3.0/rexml/parsers/baseparser.rb:185:in `pull'
        from /usr/lib/ruby/2.3.0/rexml/parsers/treeparser.rb:23:in `parse'
        from /usr/lib/ruby/2.3.0/rexml/document.rb:288:in `build'
        from /usr/lib/ruby/2.3.0/rexml/document.rb:45:in `initialize'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/md_converter.rb:15:in `new'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/md_converter.rb:15:in `convert'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/note.rb:9:in `initialize'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/enex_converter.rb:30:in `new'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/enex_converter.rb:30:in `block in parse_plural_notes'
        from /usr/lib/ruby/2.3.0/rexml/parent.rb:40:in `each'
        from /usr/lib/ruby/2.3.0/rexml/parent.rb:40:in `each'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/enex_converter.rb:27:in `map'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/enex_converter.rb:27:in `parse_plural_notes'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/enex_converter.rb:9:in `convert'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/lib/ever2boost/cli.rb:26:in `convert'
        from /var/lib/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from /var/lib/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /var/lib/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from /var/lib/gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
        from /var/lib/gems/2.3.0/gems/ever2boost-0.1.5/exe/ever2boost:4:in `<top (required)>'
        from /usr/local/bin/ever2boost:23:in `load'
        from /usr/local/bin/ever2boost:23:in `<main>'

Activity

  1. drkrthj commented on Dec 30, 2017

    @drkrthj

    same problem under macOS 10.13.2

    ever2boost version: 0.1.5

  2. iam-bartl commented on Feb 12, 2018

    @iam-bartl

    same problem. are there any solutions?

  3. narukami894 commented on Feb 27, 2018

    @narukami894

    I occured same problem, solved adding some xml options to .enex file like this;

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
    <en-export export-date="20180227T115050Z" application="Evernote" version="Evernote Mac 7.0.1 (456248)">
    - <note><title>test</title><content><![CDATA[
    + <note><title>test</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
    <en-note><div>test</div></en-note>
    ]]></content><created>20180227T115026Z</created><updated>20180227T115032Z</updated><note-attributes><author>narukami894</author><source>desktop.mac</source><reminder-order>0</reminder-order></note-attributes></note>
    </en-export>
  4. KennyMonster commented on Mar 7, 2018

    @KennyMonster

    Deleting every instance of <!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"> in the Evernote export will allow the script to run without error.

    I exported a notebook containing 52 notes. I had to delete 52 doctypes embedded in CDATA as a result.

    Even then, the resulting output was less than ideal. Every note has <?xml version="1.0" encoding="UTF-8" standalone="no"?> still embedded in it. The Evernote formatting was also completely lost.

    Overall I think there's a lot of work to be done here to make this migration path viable.

  5. muhammad-saleh commented on Apr 9, 2018

    @muhammad-saleh

    Guys, I've created this:
    give it a shot if you want
    https://github.com/muhammad-saleh/evernote2boostnote

  6. gaui commented on Dec 12, 2018

    @gaui

    Stupid hack with GNU utility sed:

    sed -E -i 's/<!\[CDATA\[<\?xml version="1\.0" encoding="UTF-8"\?>/<!\[CDATA\[/g;s/<!DOCTYPE en-note SYSTEM "http:
    \/\/xml\.evernote\.com\/pub\/enml2\.dtd">//g' notes.enex
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions