ever2boost
ever2boost copied to clipboard
Error while converting enex files under Ubuntu
/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>'
same problem under macOS 10.13.2
ever2boost version: 0.1.5
same problem. are there any solutions?
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>
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.
Guys, I've created this: give it a shot if you want https://github.com/muhammad-saleh/evernote2boostnote
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