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

Error while converting enex files under Ubuntu #9

Open
arguser opened this issue Dec 7, 2017 · 6 comments
Open

Error while converting enex files under Ubuntu #9

arguser opened this issue Dec 7, 2017 · 6 comments

Comments

@arguser
Copy link

arguser commented Dec 7, 2017

/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>'
@drkrthj
Copy link

drkrthj commented Dec 30, 2017

same problem under macOS 10.13.2

ever2boost version: 0.1.5

@iam-bartl
Copy link

same problem. are there any solutions?

@narukami894
Copy link

narukami894 commented Feb 27, 2018

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>

@KennyMonster
Copy link

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.

@muhammad-saleh
Copy link

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

@gaui
Copy link

gaui commented Dec 12, 2018

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants