XML
I started some work on the XML format the flashcard software will eventually use. This very preliminary DTD does not reflect the fact that the preview should probably be a whole card in itself, and is incomplete, but here is what I have so far. This is my first XML DTD ever.
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT cardlist (configuration?, preview?, card+)>
<!ELEMENT card (question, answer+)>
<!ELEMENT configuration (prefix*)>
<!ELEMENT preview (#PCDATA)>
<!ELEMENT question (#PCDATA)>
<!ELEMENT answer (#PCDATA)>
<!ELEMENT prefix (#PCDATA)>
<!ATTLIST question type CDATA #REQUIRED>
<!ATTLIST question use-prefix CDATA #IMPLIED>
<!ATTLIST prefix name CDATA #REQUIRED>
A sample data file would look something like this:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cardlist SYSTEM "dummy.dtd">
<cardlist>
<configuration>
<prefix name="tcphelp">Enter answers like this: TCP 53 or UDP 67 or TCP/UDP 88</prefix>
</configuration>
<preview>TCP Ports</preview>
<card>
<question type="short-answer" use-prefix="tcphelp">HTTP</question>
<answer>TCP 80</answer>
</card>
<card>
<question type="short-answer" use-prefix="tcphelp">DNS lookup</question>
<answer>UDP 53</answer>
</card>
</cardlist>
