Thinking Out Loud

August 12, 2005

XML

Filed under: 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>

Comments »

The URI to TrackBack this entry is: http://gui.blogsome.com/2005/08/12/xml/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>























Get free blog up and running in minutes with Blogsome | Theme designs available here