You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

properties.dtd 15KB

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