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

<!-- This is a DTD (document type definition) for CDL (CJKV Character
	Description Language). Tom Bishop, revised 2003.12.21. -->

<!-- A "cdl-list" element contains one or more "cdl" elements. A file 
	of character descriptions can start with the "cdl-list" tag, and
	end with the "/cdl-list" tag. -->
<!ELEMENT cdl-list (cdl)+>

<!-- Each description is contained in a "cdl" element.
	A cdl element contains one or more "comp" and/or "stroke" elements,
	which describe how to construct a character out of components
	and/or strokes. -->
<!ELEMENT cdl (comp|stroke)+>
<!ELEMENT comp EMPTY>
<!ELEMENT stroke EMPTY>

<!-- A "cdl" tag can have the following attributes. -->
<!ATTLIST cdl
	char      CDATA #IMPLIED
	uni       CDATA #IMPLIED
	variant   CDATA #IMPLIED
	points    CDATA #IMPLIED
	radical   CDATA #IMPLIED
>
<!-- The value of "char" is a string consisting of a single character,
	which is the character being described. It can be encoded in
	UTF-8, etc., or can be an XML character reference (like "&#x597d;").
		The value of "uni" is a string containing a hexadecimal Unicode
	number. It's redundant to have both "char" and "uni", but either or
	both are allowed for convenience and legibility. If neither is present,
	the description is not explicitly related to any encoded character.
		The value of "variant" is an ID string for differentiating
	between descriptions that have the same "char" or "uni" values. The
	combination of "char" (or "uni") and "variant" can uniquely identify
	a description in a database.
		The value of "points" is a pair of x,y coordinates for the
	character's bounding rectangle. Normally implicit, "0,0 128,128",
	but different for characters that don't fill the entire square; if
	it is not "0,0 128,128", then all coordinates for components and
	strokes must be scaled to fit within the given rectangle.
		The value of "radical" is a string describing what the radical(s)
	of this character are, and which strokes comprise the radical(s). The
	format currently used by Wenlin (for indexing by 214 radicals) is
	somewhat arcane and requires separate documentation, maybe revision. -->

<!-- A "comp" tag can have the following attributes. -->
<!ATTLIST comp
	char          CDATA #IMPLIED
	uni           CDATA #IMPLIED
	variant       CDATA #IMPLIED
	points        CDATA #IMPLIED
	transform     CDATA #IMPLIED
	stroke-order  CDATA #IMPLIED
>
<!-- "char", "uni", and "variant" identify the component in the
	same way that they identify the character in the cdl tag.
		"points" is a pair of x,y coordinates for the component's
	bounding rectangle, relative to the character's bounding rectangle.
	For example, "0,0 64,128" means the component fills the left half
	of the character.
		"transform" specifies rotation, flipping, etc., as needed
	for components in some rare and exotic CJKV characters.
		"stroke-order" is for a permutation of the component's strokes;
	for example, "1,3,2,4" means to exchange the second and third strokes
	of a four-stroke component.
		Note: TB2003.07.05: changed REQUIRED to IMPLIED for both
	"char" and "points". Should allow using "uni" as alternative
	to "char", so "char" isn't required; and for "points", the
	default should be "0,0 128,128". Also added "stroke-order". -->

<!-- A "stroke" tag can have the following attributes. -->
<!ATTLIST stroke
	type              CDATA            #IMPLIED
	points            CDATA            #IMPLIED
	head (normal|cut|corner|vertical)  #IMPLIED
	tail (normal|cut|long)             #IMPLIED
>
<!-- "type" is one of a set of stroke types; currently about 50 are
	defined: "h" for 横, "s" for 竖, "sg" for 竖钩, etc.
		"points" is a list of points; how many depends on the stroke type.
	For example, if type="h" then maybe points="0,64 128,64".
		"head" and "tail" describe small modifications to the beginning
	and end of the stroke, respectively. For example, the middle stroke
	of 工 has both head="cut" and tail="cut". These modifications are
	only necessary for rendering with some styles. (Wenlin needs them
	for its Song style, but ignores them for its Plain style.)
		Notes: TB2003.07.05: changed REQUIRED to IMPLIED for both
	"type" and "points". Some CDL applications don't need stroke
	types or coordinates. TB2003.12.21: added "normal" as value for
	"head" or "tail"; removed unnecessary "long" for "head". -->
