<?xml version="1.0" encoding="UTF-8"?>

<!ELEMENT JCards (DBDef, Cards, ColWidths+)>

<!ELEMENT DBDef (Settings, Categories*, Counters*, Fields*)>

<!ELEMENT Settings (displayFieldNames, displayColons, sortField?, secondSortField?, VisibleFields?)>
<!ELEMENT displayFieldNames (#PCDATA)>
<!ELEMENT displayColons (#PCDATA)>

<!ELEMENT VisibleFields (visibleField+)>
<!ELEMENT visibleField (#PCDATA)>

<!ELEMENT Categories (Category*)>
<!ELEMENT Category (categoryItem+)>
<!ATTLIST Category name ID #IMPLIED>
<!ELEMENT categoryItem (#PCDATA)>

<!ELEMENT Counters (counter*)>
<!ELEMENT counter (EMPTY)>
<!ATTLIST counter
	name ID #REQUIRED
	value CDATA #REQUIRED
	increment CDATA #REQUIRED
>

<!ELEMENT Fields (fielddef)*>
<!ELEMENT field (type, mandatory, calculation?, category?, counter?, dateFormat?, prepopulateDate?, memoLines?, displayAsHTML?)>
<!ATTLIST field
    name ID #REQUIRED
>
<!ELEMENT type (#PCDATA)>
<!ELEMENT mandatory (#PCDATA)>
<!ELEMENT calculation (#PCDATA)>
<!ELEMENT category (#PCDATA)>
<!ELEMENT counter (#PCDATA)>
<!ELEMENT dateFormat (#PCDATA)>
<!ELEMENT prepopulateDate (#PCDATA)>
<!ELEMENT memoLines (#PCDATA)>
<!ELEMENT displayAsHTML (#PCDATA)>

<!ELEMENT Cards (info, Card*)>
<!ELEMENT info (#PCDATA)>
<!ELEMENT Card (field*)>
<!ELEMENT field (#PCDATA)>
<!ATTLIST field name CDATA #REQUIRED>

<!ELEMENT ColWidths (width+)>
<!ELEMENT width (#PCDATA)>
