[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: User-defined character and paragraph styles
Dear ODF-TC Members, while reading one proposal for ODF, I came up with a better idea. [for original proposal see http://wiki.oasis-open.org/office/User-defined_character_and_paragraph_styles] Instead of defining explicitly every element-style that can be inherited by another style, I would solve this issue more broadly: INHERITANCE MECHANISM ====================== Define an INHERITANCE mechanism, e.g. style <X> inherits from style <Y>, <Z>, ... This would be transcribed as: - ANY property of X that is defined in Y is inherited from Y. [and not explicitly defined in X] - IF there are further properties defined in Z, those get inherited from Z, and so on. [Y has precedence over Z, ...] Therefore, the example from the wiki could be easily solved via: <paragraph style> _P_Name_ inherits from <character style> _C_Name_ As I don't understand XML, this is only a tentative schema: <define name="style-style-content" combine="choice"> <group> <attribute name="style:family"> <value>paragraph</value> </attribute> <optional> <attribute name="style:inherit"> <value>style_name_from_which_it_is_inherited</value> </attribute> </optional> <optional> <ref name="style-paragraph-properties"/> </optional> ... </group> </define> This option is more flexible and it is possible to inherit various attributes from different styles, e.g. the text-size from one char-style, the font-name from a different style, ... . NOTE ===== Circular references won't lock the inheritance mechanism, because an attribute that is not present in either style, is not defined, so will be ignored. Therefore, an implementation detail would be (but not necessary for ODF to specify): list all properties in all styles. Resolve inherited properties only if present in this list and a suitable graph can be build for that property. Sincerely, Leonard P.S. This would enable a nice mechanism for the page to inherit atributes defined for an element displayed on that page!