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

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

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

<!ELEMENT Settings (memoLines, dateFormat, prepopulateDate, displayFieldNames, sortField?, secondSortField?, VisibleFields?)>
<!ELEMENT memoLines (#PCDATA)>
<!ELEMENT dateFormat (#PCDATA)>
<!ELEMENT prepopulateDate (#PCDATA)>
<!ELEMENT displayFieldNames (#PCDATA)>
<!ELEMENT sortField (#PCDATA)>
<!ATTLIST sortField sortDirection CDATA #IMPLIED>
<!ELEMENT secondSortField (#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 fielddef (EMPTY)>
<!ATTLIST fielddef
    name ID #REQUIRED
    type CDATA #REQUIRED
    mandatory CDATA #IMPLIED
    category CDATA #IMPLIED
    counter CDATA #IMPLIED
    memoLines CDATA #IMPLIED
>

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

<!ELEMENT ColWidths (width+)>
<!ATTLIST ColWidths type CDATA #REQUIRED>
<!ELEMENT width (#PCDATA)>
