Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

Documentation for ENML Restrictions

enml

  • Please log in to reply
5 replies to this topic

#1 frethop

frethop

  • Pip
  • Title: Member
  • Group: Members
  • 29 posts

Posted 31 maio 2012 - 04:36

I am trying to create a note with an application. I want to generate some good looking ENML. I am confused about ENML that should be legal yest does not pass "ENML Verification".

Example: I want to generate
<h2 style="font-family:Tahoma,Arial,Georgia">

According to the specs (http://dev.evernote....apters/ENML.php) this should be good and the online ENML editor allows me to enter this by hand (see http://enml-editor.ping13.net)

BUT...I get an error when I use an application to create this in note content. The error refers to "ENML verification":

EDAMUserException(errorCode:ENML_VALIDATION, parameter:Attribute "style" must be declared for element type "h2".)

So I am confused. Is this legal? Is it not? Is there a set of documentation that will define all this for me?

Thanks!

#2 AndyDent

AndyDent

  • PipPipPip
  • Title: Bushwhacker
  • Group: Members
  • 135 posts

Posted 31 maio 2012 - 10:09

I was looking at the DTD (which I find difficult, much prefer other kinds of schema). It seems that h2 does allow for the style attribute and the schema does not (can not) specify anything about the contents of a style attribute.

Just looking through a recent export, I found an example coming from Evernote:


<h2 style="margin-top: 12pt; margin-right: 0in; margin-bottom: 3pt; margin-left: 0.55in; text-indent: -0.3in; page-break-after: avoid; font-size: 14pt; font-family: Arial, sans-serif; font-weight: normal;">


So, I would try trimming the list of font names on the assumption that Evernote's internal CSS parser only handles one font name.

#3 frethop

frethop

  • Pip
  • Title: Member
  • Group: Members
  • 29 posts

Posted 01 junho 2012 - 12:18

Thanks. Having a look at the DTD would tell you that there are many tags with style attributes. However, I can't get several to take any kind of specification; even my "h2" problem will not take a single font specification. Thanks for the suggestion, though.

This is particularly frustrating because it would seem that there is a separate specification for the "internal CSS parser" (good term).

An interesting check is to use Evernote Hello, which posts nicely formatted notes to your Evernote account, and look at the notes it generates. There are some pretty hefty style specifications there, including special "x-evernote" style specs.

#4 AndyDent

AndyDent

  • PipPipPip
  • Title: Bushwhacker
  • Group: Members
  • 135 posts

Posted 01 junho 2012 - 12:50

I forgot to clarify that example I showed was exported from the Evernote Windows client (when I said from Evernote) so it's real content with a font-family tag in the h2 style attribute.

Hmm, is it something stupid like them expecting a space after the colon in the CSS? Or, maybe, only certain font names work?

#5 ping13

ping13

  • PipPipPip
  • Title: Bushwhacker
  • Group: Members
  • 107 posts

Posted 01 junho 2012 - 08:02

Hi,

just a guess: Do you use enml.dtd or enml2.dtd? In other words, check if the content of your note has the correct header:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
....
</en-note>

Good luck
Stephan
--
Reveal your hidden notes with NotePlaces
Edit your notes as ENML with http://enml-editor.ping13.net
Sync your Simplenote notes with Evernote at http://simpleforever.net

#6 frethop

frethop

  • Pip
  • Title: Member
  • Group: Members
  • 29 posts

Posted 04 junho 2012 - 12:29

Hi,

just a guess: Do you use enml.dtd or enml2.dtd? In other words, check if the content of your note has the correct header:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
....
</en-note>

Good luck
Stephan


BRILLIANT! I completely missed this. Switching to "enml2.dtd" did the trick. Many many thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Clip to Evernote