# ========================================================= # # (c) 2004, RenderX # # Author: Alexander Peshkov # # Permission is granted to use this document, copy and # modify free of charge, provided that every derived work # bear a reference to the present document. # # This document contains a computer program written in # XSL Transformations Language. It is published with no # warranty of any kind about its usability, as a mere # example of XSL technology. RenderX shall not be # considered liable for any damage or loss of data caused # by use of this program. # # ========================================================= namespace local = "" default namespace fo = "http://www.w3.org/1999/XSL/Format" namespace rx = "http://www.renderx.com/XSL/Extensions" include "basic_properties.rnc" # =============================================================== # Properties grouping. Groups used by different elements classes # =============================================================== # =============================================================== # Entity definitions for common groups of properties # This grouping reflects properties co occurrence, rather than # property semantics. It does not correspond to grouping in the # spec. # =============================================================== # Accessibility Properties accessibility-properties = source-document.attr?, role.attr? #MEMO: XSLFO is selfcontradictory: # Those properties allowed on all inline elements excep to for fo:character, fo:bidi-override and fo:inline-conteiner # At the same time spec says about those properties: # XSL> It is used by all formatting objects that can be contained in fo:flow or fo:static-content (all formatting # XSL> objects that can be directly created from an XML source element). # Thus they must be present on fo:character, fo:bidi-override, fo:inline-conteiner as well # (there are more elements missing these properties) # Note also, that comment in the round brackets seems to be meaningless. # Relative Position Properties # 'position' shorthand property also makes part of this group relative-position-properties = relative-position.attr?, relative-position-shorthand.attr? # Absolute Position Properties absolute-position-properties = absolute-position.attr, absolute-position-shorthand.attr?, top.attr?, right.attr?, bottom.attr?, left.attr? # Aural Properties # 'cue' and 'pause' shorthand properties are also included #MEMO: XSLFO is selfcontradictory here in the same way # it is for Accessibility Properties - Aural properties allowed everywhere # but yet not specified on some elements, e.g. fo:block-container or fo:inline-container. # We believe this is an omission and therefor those properties are available everywhere. aural-properties-inheritable = azimuth.attr?, elevation.attr?, pitch.attr?, pitch-range.attr?, play-during.attr?, richness.attr?, speak.attr?, speak-header.attr?, speak-numeral.attr?, speak-punctuation.attr?, speech-rate.attr?, stress.attr?, voice-family.attr?, volume.attr? aural-properties-unheritable = cue.attr?, cue-after.attr?, cue-before.attr?, pause.attr?, pause-after.attr?, pause-before.attr? aural-properties = aural-properties-inheritable, aural-properties-unheritable # Common Border, Padding, and Background Properties # Related shorthand properties are also included border-properties = border.attr?, border-after-color.attr?, border-after-style.attr?, border-after-width.attr?, border-after-width.length.attr?, border-after-width.conditionality.attr?, border-before-color.attr?, border-before-style.attr?, border-before-width.attr?, border-before-width.length.attr?, border-before-width.conditionality.attr?, border-bottom.attr?, border-bottom-color.attr?, border-bottom-style.attr?, border-bottom-width.attr?, border-bottom-width.length.attr?, border-bottom-width.conditionality.attr?, border-color.attr?, border-end-color.attr?, border-end-style.attr?, border-end-width.attr?, border-end-width.length.attr?, border-end-width.conditionality.attr?, border-left.attr?, border-left-color.attr?, border-left-style.attr?, border-left-width.attr?, border-left-width.length.attr?, border-left-width.conditionality.attr?, border-right.attr?, border-right-color.attr?, border-right-style.attr?, border-right-width.attr?, border-right-width.length.attr?, border-right-width.conditionality.attr?, border-start-color.attr?, border-start-style.attr?, border-start-width.attr?, border-start-width.length.attr?, border-start-width.conditionality.attr?, border-style.attr?, border-top.attr?, border-top-color.attr?, border-top-style.attr?, border-top-width.attr?, border-top-width.length.attr?, border-top-width.conditionality.attr?, border-width.attr? padding-properties = padding.attr?, padding-after.attr?, padding-after.length.attr?, padding-after.conditionality.attr?, padding-before.attr?, padding-before.length.attr?, padding-before.conditionality.attr?, padding-bottom.attr?, padding-bottom.length.attr?, padding-bottom.conditionality.attr?, padding-end.attr?, padding-end.length.attr?, padding-end.conditionality.attr?, padding-left.attr?, padding-left.length.attr?, padding-left.conditionality.attr?, padding-right.attr?, padding-right.length.attr?, padding-right.conditionality.attr?, padding-start.attr?, padding-start.length.attr?, padding-start.conditionality.attr?, padding-top.attr?, padding-top.length.attr?, padding-top.conditionality.attr? background-properties = background.attr?, background-attachment.attr?, background-color.attr?, background-image.attr?, background-position.attr?, background-position-vertical.attr?, background-position-horizontal.attr?, background-repeat.attr?, rx-background-content-type.attr?, rx-background-content-height.attr?, rx-background-content-width.attr?, rx-background-scaling.attr? border-padding-background-properties = border-properties, padding-properties, background-properties # Border Precedence Properties for tables border-precedence-properties = border-after-precedence.attr?, border-before-precedence.attr?, border-end-precedence.attr?, border-start-precedence.attr? # Box Size Properties height-properties = height.attr?, min-height.attr?, max-height.attr?, block-progression-dimension.attr?, block-progression-dimension.minimum.attr?, block-progression-dimension.optimum.attr?, block-progression-dimension.maximum.attr? width-properties = width.attr?, min-width.attr?, max-width.attr?, inline-progression-dimension.attr?, inline-progression-dimension.minimum.attr?, inline-progression-dimension.optimum.attr?, inline-progression-dimension.maximum.attr? box-size-properties = height-properties, width-properties # Common Area Properties area-properties-inheritable = display-align.attr?, reference-orientation.attr?, writing-mode.attr? area-properties-unheritable = clip.attr?, overflow.attr? area-properties = area-properties-inheritable, area-properties-unheritable # Common Font Properties # 'font' shorthand property is also included font-properties = font.attr?, font-selection-strategy.attr?, font-family.attr?, font-size.attr?, font-size-adjust.attr?, font-stretch.attr?, font-style.attr?, font-variant.attr?, font-weight.attr? # Common Hyphenation Properties - Inline # 'xml:lang' shorthand property is also included hyphenation-properties-inline = country.attr?, language.attr?, script.attr?, attribute xml:lang { text }?, hyphenate.attr?, hyphenation-character.attr?, hyphenation-push-character-count.attr?, hyphenation-remain-character-count.attr? # Common Hyphenation Properties - Block hyphenation-properties-block = hyphenation-keep.attr?, hyphenation-ladder-count.attr? hyphenation-properties = hyphenation-properties-inline, hyphenation-properties-block # Common CSS Margin Properties # 'margin' shorthand property is also included margin-properties-CSS = margin.attr?, margin-bottom.attr?, margin-left.attr?, margin-right.attr?, margin-top.attr? # Common Margin Properties - Block margin-properties-inheritable = start-indent.attr?, end-indent.attr? margin-properties-block = margin-properties-CSS, space-after.attr?, space-after.minimum.attr?, space-after.optimum.attr?, space-after.maximum.attr?, space-after.precedence.attr?, space-after.conditionality.attr?, space-before.attr?, space-before.minimum.attr?, space-before.optimum.attr?, space-before.maximum.attr?, space-before.precedence.attr?, space-before.conditionality.attr? # Common Margin Properties - Inline margin-properties-inline = margin-properties-CSS, space-start.attr?, space-start.minimum.attr?, space-start.optimum.attr?, space-start.maximum.attr?, space-start.precedence.attr?, space-start.conditionality.attr?, space-end.attr?, space-end.minimum.attr?, space-end.optimum.attr?, space-end.maximum.attr?, space-end.precedence.attr?, space-end.conditionality.attr? # Area Alignment Properties # 'vertical-align' shorthand is added # 'relative-align' - excluded area-alignment-properties = alignment-adjust.attr?, alignment-baseline.attr?, baseline-shift.attr?, dominant-baseline.attr?, vertical-align.attr? # Line Height Properties line-height-properties = line-height.attr?, line-height.minimum.attr?, line-height.optimum.attr?, line-height.maximum.attr?, line-height.precedence.attr?, line-height.conditionality.attr?, line-height-shift-adjustment.attr? # Line Related Properties line-related-properties = text-align.attr?, text-align-last.attr?, text-indent.attr?, last-line-end-indent.attr?, line-stacking-strategy.attr?, linefeed-treatment.attr?, white-space.attr?, white-space-treatment.attr?, white-space-collapse.attr?, wrap-option.attr?, direction.attr? # Character Properties character-properties-inheritable = letter-spacing.attr?, letter-spacing.minimum.attr?, letter-spacing.optimum.attr?, letter-spacing.maximum.attr?, letter-spacing.precedence.attr?, letter-spacing.conditionality.attr?, word-spacing.attr?, word-spacing.minimum.attr?, word-spacing.optimum.attr?, word-spacing.maximum.attr?, word-spacing.precedence.attr?, word-spacing.conditionality.attr?, glyph-orientation-horizontal.attr?, glyph-orientation-vertical.attr?, score-spaces.attr?, text-transform.attr? character-properties-unheritable= #MEMO: There is a problem with these two properties in XSL FO spec. # They are assumed to be allowed everywhere but somehow on of them # missing on fo:inline, another on fo:leader and both absent on fo:bidi-override. # They are not present on fo:block also. # We suppose that those omissions are erratic. and allow them on all elements that can cotain text. # It makes sence to allow text-decoration on the graphical inlines also. text-decoration.attr?, text-shadow.attr? #NOTE: Those properties apllies to char elements but they are already included into 'inheritable-properties' set #font-properties, #line-height-properties character-properties = character-properties-inheritable, character-properties-unheritable # Common Keeps and Breaks Properties - Atomic objects # Keeps only keeps-properties-atomic = keep-with-next.attr?, keep-with-next.within-line.attr?, keep-with-next.within-column.attr?, keep-with-next.within-page.attr?, keep-with-previous.attr?, keep-with-previous.within-line.attr?, keep-with-previous.within-column.attr?, keep-with-previous.within-page.attr? # Common Keeps and Breaks Properties - Atomic objects # Keeps and Breaks # 'page-break-*' shorthand properties are also included keeps-and-breaks-properties-atomic = keeps-properties-atomic, break-after.attr?, break-before.attr?, page-break-after.attr?, page-break-before.attr? # Common Keeps and Breaks Properties - Inline # 'page-break-inside' shorthand property is also included keeps-and-breaks-properties-inline-inheritable = keep-together.attr?, keep-together.within-line.attr?, keep-together.within-column.attr?, keep-together.within-page.attr?, page-break-inside.attr? #MEMO: Do we really need separate block and inline groups here # Common Keeps and Breaks Properties - Block keeps-and-breaks-properties-block-inheritable = orphans.attr?, widows.attr? # Leader and Rule Properties leader-properties = leader-alignment.attr?, leader-pattern.attr?, leader-pattern-width.attr?, leader-length.attr?, leader-length.minimum.attr?, leader-length.optimum.attr?, leader-length.maximum.attr?, rule-style.attr?, rule-thickness.attr? # Table Properties # 'border-spacing' shorthand property is also included # 'inherit' property added to table-omit-...er-at-break table-properties-inheritable = border-collapse.attr?, border-spacing.attr?, border-separation.attr?, border-separation.inline-progression-direction.attr?, border-separation.block-progression-direction.attr?, caption-side.attr?, empty-cells.attr? table-properties-unheritable = table-layout.attr?, table-omit-header-at-break.attr?, table-omit-footer-at-break.attr?, rx-table-omit-initial-header.attr? table-properties = table-properties-inheritable, table-properties-unheritable # List Properties list-properties = provisional-distance-between-starts.attr?, provisional-label-separation.attr? # Visibility Properties # NOTE: 'visibility' is inheritable, but 'z-index' is not. visibility-properties = visibility.attr?, z-index.attr? # =============================================================== # Set of 'explicitly' inheritable properties. This includes attributes # marked as inheritable in the spec only! # We define two sets of inheritable properties: # 1. Basic properties applicable to inline-level elements with character-only content # 2. Full set of inheritable properties # =============================================================== inheritable-properties-inline = aural-properties-inheritable, color.attr?, character-properties-inheritable, font-properties, hyphenation-properties-inline, line-height-properties, visibility.attr? inheritable-properties-block = table-properties-inheritable, area-properties-inheritable, hyphenation-properties-block, margin-properties-inheritable, intrusion-displace.attr?, # 'intrusion-displace' applies to: fo:block, fo:block-container, fo:table-and-caption, fo:table, fo:table-caption, fo:list-block, fo:list-item. keeps-and-breaks-properties-inline-inheritable, keeps-and-breaks-properties-block-inheritable, leader-properties, #MEMO: Should we move this one to inheritable-properties-inline? line-related-properties, list-properties, relative-align.attr? #NOTE: Property 'relative-align' applies to fo:list-item and fo:table-cell only. inheritable-properties = inheritable-properties-inline, inheritable-properties-block # =============================================================== # Common property subsets. # =============================================================== # Common block properties (those properties applies to any type of block-container as well common-block-properties = id.attr?, rx-key.attr?, accessibility-properties, aural-properties-unheritable, border-padding-background-properties, margin-properties-block, inheritable-properties # Properties for fo:block and fo:block-container block-properties = common-block-properties, clear.attr?, span.attr?, keeps-and-breaks-properties-atomic, relative-position-properties # Common inline properties #MEMO: Spec says that text-altitude/text-depth applicable only to # fo:block, fo:character, fo:leader, fo:page-number, fo:page-number-citation # We believe this is an omission and they must be allowed on all elements # that can have text children. common-inline-properties = id.attr?, rx-key.attr?, accessibility-properties, aural-properties-unheritable, area-alignment-properties, border-padding-background-properties, character-properties-unheritable, keeps-properties-atomic, margin-properties-inline, relative-position-properties, text-altitude.attr?, text-depth.attr?, inheritable-properties-inline # Properties for nonempty inline elements inline-properties = common-inline-properties, inheritable-properties-block # Properties for graphical inline elements # NOTE: src attribute exclueded since it's not applicable to fo:instream-foreign-object graphic-properties = #MEMO: We can replace part of the definition here with 'common-inline-properties' set # - it will be formaly rightfil since the only difference made by text-shadow, text-altitude, # text-depth and inheritable-properties-inline and both of them are allowed here. # At the same time those properties do not make any sense being specified on those # elements since they will be never applied. id.attr?, rx-key.attr?, accessibility-properties, aural-properties, area-properties-unheritable, border-padding-background-properties, margin-properties-inline, relative-position-properties, area-alignment-properties, box-size-properties, keeps-properties-atomic, line-height-properties, display-align.attr?, content-type.attr?, content-height.attr?, content-width.attr?, scaling.attr?, scaling-method.attr?, text-align.attr?, text-decoration.attr?