Mnemosyne XML DTD

The following is not an actual DTD, but should be an overview sufficient to give users a general understanding of the Mnemosyne XML.

WARNING: This format is expected to change significantly in Mnemosyne 2.0.

Sample Mnemosyne XML export for one card:

<?xml version="1.0" encoding="UTF-8"?>
<mnemosyne core_version="1" time_of_start="1215720000" >
<category active="1">
 <name><th-en></name>
</category>
<category active="1">
 <name><en-th></name>
</category>
<item id="74b1b599" gr="2" e="2.500" ac_rp="2" rt_rp="0" lps="0"
ac_rp_l="2" rt_rp_l="0" l_rp="32" n_rp="33">
 <cat><th-en></cat>
 <Q>เงา</Q>
 <A>shadow; reflection; image</A>
</item>
<item id="74b1b599.inv" gr="2" e="2.500" ac_rp="2" rt_rp="0" lps="0"
ac_rp_l="2" rt_rp_l="0" l_rp="32" n_rp="34">
 <cat><en-th></cat>
 <Q>shadow; reflection; image</Q>
 <A>เงา</A>
</item>
</mnemosyne>

Attributes of Item

Note: you don't need to set any of the following explictly yourself. They are given suitable defaults for new cards when you import them.

id= created as a hash of the data
gr= the grade, default is 0
e= easiness
ac_rp= acquisition reps
rt_rp= retention reps
lps= lapses
ac_rp_l, rt_rp_l = ... since lapse
l_rp= last rep
n_rp= next rep

Relax NG-schema

Here is a Relax NG-schema in compact notation. Relax NG is a schema language, like DTD, but more expressive and easier to read and write. It's generated by Trang, a program that can convert between different types of schemas, DTD, XSD, RelaxNG and examples. An example can be converted into a schema automatically, but sometimes a little editing is needed.

default namespace = ""
start =
element mnemosyne {
attribute core_version { xsd:integer },
attribute time_of_start { xsd:integer },
element category {
attribute active { xsd:integer },
element name { xsd:NCName }
}+,
element item {
attribute ac_rp { xsd:integer },
attribute ac_rp_l { xsd:integer },
attribute e { xsd:decimal },
attribute gr { xsd:integer },
attribute id { xsd:NMTOKEN },
attribute l_rp { xsd:integer },
attribute lps { xsd:integer },
attribute n_rp { xsd:integer },
attribute rt_rp { xsd:integer },
attribute rt_rp_l { xsd:integer },
element cat { xsd:NCName },
element Q { text },
element A { text }
}+
}

Thanks for your good work!

Isak