Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

properties.dtd 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <!-- $Id$ -->
  2. <!--
  3. DTD for foproperties.xml and svgproperties.xml
  4. -->
  5. <!DOCTYPE property-list [
  6. <!ELEMENT property-list (generic-property-list?, element-property-list*) >
  7. <!-- This defines properties which are generic: meaning they are valid for
  8. any formatting object in the namespace associated with this properties
  9. file.
  10. -->
  11. <!ELEMENT generic-property-list (property+) >
  12. <!-- This defines properties which are specific to a particular element.
  13. The elements are specified in one or more localname elements. This
  14. will generate code which can be used to set up element-specific
  15. mappings for the PropertyListBuilder object.
  16. -->
  17. <!ELEMENT element-property-list (localname+, property+) >
  18. <!ELEMENT localname (#PCDATA) >
  19. <!-- Define a single property in the current namespace -->
  20. <!ELEMENT property (name, (use-generic | datatype), class-name?, inherited?,
  21. default?, enumeration?, datatype-conversion*, compound?,
  22. keyword-equiv*, percent-ok?, auto-ok?, derive?, corresponding? ) >
  23. <!-- If type is set to "ref", then this is not a new property definition,
  24. but rather a reference to a property allready defined (should be in
  25. another namespace). The "family" attribute then indicates in which
  26. other property family the referenced attribute is defined. This is
  27. used to let SVG reuse font-related properties defined in FO.
  28. The family attribute is ignored if type isn't "ref".
  29. If type = "generic", this is not a "real" property but rather a
  30. template on which one or usually several other properties are
  31. based. This reduces typing in the properties files and can reduce the
  32. number and size of property classes created.
  33. -->
  34. <!ATTLIST property
  35. type (ref|generic|normal) "normal"
  36. family (fo|svg) "fo"
  37. >
  38. <!-- Sub-elements of property. -->
  39. <!-- This gives the name of the attribute used to specify values for this
  40. property in input FO or SVG files. It MUST be specified.
  41. -->
  42. <!ELEMENT name (#PCDATA) >
  43. <!-- This gives the class name of the Java class which will be created to
  44. represent values for this property. It doesn't need to be specified if
  45. it can be deduced from the "name". The rule is that the first letter
  46. of the property name and any name following a "-" are capitalized and
  47. the "-" characters are removed. If you want to force a name, use the
  48. class-name sub-element.
  49. -->
  50. <!ELEMENT class-name (#PCDATA) >
  51. <!-- This indicates that this property is based on a generic property
  52. datatype. This may be one hand-coded, such as SVGLengthProperty, or it
  53. may be one which is created by a generic property definition in the
  54. properties.xml file being processed. The content of this element is
  55. the CLASSNAME of the generic property (NOTE: not its name). A property
  56. can be based on a generic property and still override certain aspects
  57. such as the default value, simply by specifying the appropriate
  58. sub-elements.
  59. If the "ispropclass" attribute = "true", then the contents of the
  60. use-generic element is the name of a hard-coded Property subclass
  61. and not of a generated Property.Maker subclass. This is currently
  62. only used for the SVG properties, because they don't have a
  63. rule-based relationship between the actual Property class name
  64. and the name of the datatype stored by objects of that class.
  65. -->
  66. <!ELEMENT use-generic (#PCDATA) >
  67. <!ATTLIST use-generic
  68. ispropclass (true | false ) "false"
  69. >
  70. <!-- This indicates whether the property is inherited or not. Use the value
  71. true for inherited and false for non-inherited. If the attribute
  72. "type" is set to "specified", the specified rather than the computed
  73. value of the property is inherited. An example is line-height, which
  74. if specified using relative units or a percent, is recalculated
  75. relative to the FONTSIZE of the current FO.
  76. -->
  77. <!ELEMENT inherited (#PCDATA) >
  78. <!ATTLIST inherited
  79. type (specified | computed) "computed"
  80. >
  81. <!-- This gives the datatype of the stored property values. It shouldn't be
  82. specified if the property has a use-generic element. The value of this
  83. element should be the name of either a basic Java class (String,
  84. Integer) or a class defined as a FOP or SVG datatype (eg. ColorType).
  85. NOTE: the value "Enum" is special and indicates an enumerated
  86. datatype, stored as a Java "int". There is an EnumProperty class, but
  87. no corresponding Enum class.
  88. -->
  89. <!ELEMENT datatype (#PCDATA) >
  90. <!-- This element is used to specify the allowable values for enumerated
  91. datatypes (<datatype>Enum</datatype>). Each value sub-element
  92. specifies a possible value for the property. The "const" attribute for
  93. each value is used to generate a public static constant value in the
  94. class which can be referenced in code to test the property value. It
  95. must be a legal Java identifier. By convention, use all caps.
  96. -->
  97. <!ELEMENT enumeration (value+) >
  98. <!ELEMENT value (#PCDATA) >
  99. <!ATTLIST value
  100. const CDATA #REQUIRED
  101. >
  102. <!-- This gives the default value for a property if it is not specified on
  103. a given FO. (The spec calls this the "initial" value.)
  104. It may also be used to specify a default value for a particular
  105. component of a compound property. This is used to give each component
  106. its initial value if components are only partially specified in the
  107. FO file.
  108. NOTE: It should be an expression which can be parsed to give a legal
  109. value for the property! This can't be checked by the generating
  110. script, so if there is a problem, it will only be seen at runtime.
  111. If the attribute "contextdep" is present and set to "true", the
  112. generated code for the Maker will create a new Property object each
  113. time it is asked to make the default value. Otherwise (the usual
  114. case), it will only make one Property object with the default value
  115. and return it on each call. Context-dependent default values include
  116. those specified with relative units (eg. 1em).
  117. The "subproperty" attribute can be used on properties which are
  118. based on generic property specifications to specify a default value
  119. for a particular component. For example, the border-end-width property
  120. is based on GenericCondBorderWidth and specifies a specific default
  121. for the "conditionality" component.
  122. -->
  123. <!ELEMENT default (#PCDATA) >
  124. <!ATTLIST default
  125. contextdep (true | false) "false"
  126. subproperty CDATA #IMPLIED
  127. >
  128. <!-- The datatype-conversion element(s) specify how to handle property
  129. values which can be specified in several ways. For example, the
  130. line-height property can be specified as a Length, or as a number or
  131. as a percent, which are both interpreted as being a factor of the
  132. current font-size. The datatype for this property is Length. The
  133. datatype-conversion element is used to handle the cases in which the
  134. Property parser returns a type which is not a Length. Each element
  135. tests it against a possible property type. The content gives the
  136. actual code which should be inserted in the generated class in order
  137. to correctly initialize the property value.
  138. NOTE: the use of this for Color properties is rather a hack. All color
  139. properties can be specified by a large number of keywords. To be
  140. consistent with my logic we should use the keyword-equiv element. But
  141. that was a lot of work. So for now, if the value evaluates to a String
  142. and not to a ColorType, the datatype-conversion just uses it to
  143. directly initialize a ColorType object.
  144. -->
  145. <!ELEMENT datatype-conversion (#PCDATA) >
  146. <!-- The attribute from-type gives a possible property datatype, such as
  147. Number or String. The varname gives the name of a variable which can
  148. be used in the content of the datatype-conversion element. If the type
  149. of the variable is not the same as from-type, it may be specified with
  150. the attribute vartype.
  151. An example of usage is from the line-height property. This should be
  152. a Length object, but may be specified as a Number, which is interpreted
  153. as though it were a percentage of the current font-size.
  154. -->
  155. <!ATTLIST datatype-conversion
  156. from-type CDATA #REQUIRED
  157. vartype CDATA #IMPLIED
  158. varname CDATA #REQUIRED
  159. >
  160. <!-- The compound element indicates that the property is a "compound"
  161. property as defined in the XSL specification. It is specified as one
  162. or more individual attributes whose names are built up from the base
  163. property name and the name of a compoent. Each "subproperty" element
  164. describes a component of a compound property.
  165. An example is space-before.
  166. -->
  167. <!ELEMENT compound (subproperty+) >
  168. <!-- Describe one component of a compound property. Only the name and the
  169. datatype should be specified. For example, in the space-before
  170. property, the optimum component has the name optimum and the datatype
  171. Length.
  172. -->
  173. <!ELEMENT subproperty (name, datatype, auto-ok?, default?, corresponding?,
  174. enumeration?, keyword-equiv? ) >
  175. <!-- This element which may be repeated, specifies keyword shorthands for
  176. non-enumerated properties. For example, the border-width family of
  177. properties can be specified either by a Length (eg. 1pt) or by one of
  178. the keywords "thin", "medium", or "thick", each of which corresponds
  179. to a "user-agent specific value" (XSL Spec.) These values are defined
  180. by the keyword-equiv element. The "match" attribute gives the string
  181. keyword value and the content is the replacement value, which should
  182. be able to be evaluated to produce an object of the property's
  183. datatype (such as Length). An example is:
  184. <keyword-equiv match="thin" eval="true">0.5pt</keyword-equiv>
  185. The "eval" attribute indicates whether the specified value must be
  186. "parsed" using the Property parser or whether it can be used to
  187. directly construct an object of the appropriate datatype. The default
  188. is to evaluate the specified value (like the default specification).
  189. -->
  190. <!ELEMENT keyword-equiv (#PCDATA) >
  191. <!ATTLIST keyword-equiv
  192. match CDATA #REQUIRED
  193. eval (true|false) "true"
  194. >
  195. <!-- This element if present indicates that percent specifications are
  196. allowed as property values. The attribute "base" indicates how the
  197. actual value is calculated.
  198. FONTSIZE - the value is a percent of the current font-size
  199. INH-FONTSIZE - the value is a percent of the inherited
  200. font-size. This is necessary because font-size itself can be specified
  201. as a percent!
  202. CONTAINING-BOX - the value is a percent of the appropriate
  203. dimension of the containing box of this FO.
  204. If none of these is specified, the content of the element is
  205. assumed to be a Java expression which can be used to calculate an
  206. absolute value. This expression can assume that the variables
  207. propertyList and fo are in scope and refer to the FO on which the
  208. property was specified as a percent.
  209. -->
  210. <!ELEMENT percent-ok (#PCDATA) >
  211. <!ATTLIST percent-ok
  212. base (FONTSIZE | INH-FONTSIZE | CONTAINING-BOX) #IMPLIED
  213. >
  214. <!-- This element if present indicates that a value of "auto" for a Length
  215. specification is allowed. If "auto" is specified, a LengthProperty object
  216. is created which holds a Length object of type "AUTO".
  217. -->
  218. <!ELEMENT auto-ok EMPTY >
  219. <!-- This element if present indicates that the value of the property may
  220. be computed (derived) from other properties if it isn't specified. It
  221. assumes that the property is an Enum datatype. (Currently only used
  222. for text-align-last.)
  223. The "from" attribute gives the name of the property from which this
  224. property is derived.
  225. Each "if" sub-element specifies a possible value. The "match"
  226. attribute is compared with the value of the "derive-from" property. If
  227. it is equal, the value of the current property is set to the value
  228. specified by the content of the "if" element.
  229. -->
  230. <!ELEMENT derive (if+) >
  231. <!ATTLIST derive
  232. from CDATA #REQUIRED
  233. >
  234. <!ELEMENT if (#PCDATA) >
  235. <!ATTLIST if
  236. match CDATA #REQUIRED
  237. >
  238. <!-- This element indicates that the value of the property is the same as
  239. that of a "corresponding" absolute or writing-mode-relative property.
  240. if the "use-if-specified" attribute has the value "true", then the
  241. corresponding property value takes precedence over the property on
  242. which it is specified. To be conformant to the specification, all the
  243. the "absolute" versions of properties have precedence.
  244. Example: if a get() call is made on padding-end for a FO using lr-tb
  245. writing-mode, then the padding-right property will be used if it is
  246. specified, even if padding-end is actually specified.
  247. However, if a get() is made on padding-right, the value of padding-end
  248. will only be used if padding-right isn't specified on the FO.
  249. -->
  250. <!ELEMENT corresponding (propval, propexpr?) >
  251. <!ATTLIST corresponding
  252. use-if-specified (true|false) "false"
  253. >
  254. <!-- If the value must be calculated using several other properties, the
  255. propexpr element may be used. Then only example I know of are the
  256. indent properties which are calculated based on the margin-* values
  257. if those are specified, plus the corresponding padding and border-width
  258. values.
  259. -->
  260. <!ELEMENT propexpr (propval | #PCDATA)+ >
  261. <!-- The name of the corresponding property is given in the propval element.
  262. The conversion between absolute and relative property names is
  263. made using wmrel2abs or wm2bs2rel elements, intermixed with text.
  264. For example, for the property "padding-left", the corresponding
  265. property is "padding-start" if the inline progression direction is
  266. left to right. This is expressed in the properties file with the
  267. expression "padding-<wmabs2rel dir='LEFT'/>". The wmabs2rel element
  268. is replaced by the writing-mode relative direction which corresponds
  269. to the absolute direction LEFT using the writing-mode in effect for the
  270. flow object where this property is specified.
  271. -->
  272. <!ELEMENT propval (wmrel2abs | wmabs2rel | #PCDATA)+ >
  273. <!ELEMENT wmrel2abs EMPTY>
  274. <!ATTLIST wmrel2abs
  275. dir (BEFORE | AFTER | START | END | BLOCKPROGDIM | INLINEPROGDIM)
  276. #REQUIRED
  277. >
  278. <!ELEMENT wmabs2rel EMPTY>
  279. <!ATTLIST wmabs2rel
  280. dir (TOP | BOTTOM | LEFT | RIGHT | HEIGHT | WIDTH ) #REQUIRED
  281. >