2.4.9 The setCellProperties Element

setCellProperties
   :applyToConverse=bool?
=> (setStyle | setFrameStyle | setFormat | setMetaData)* union[union_]?

The setCellProperties element sets style properties of cells or row or column labels.

Interpreting setCellProperties requires answering two questions: which cells or labels to style, and what styles to use.

Which Cells?

union => intersect+

intersect => where+ | intersectWhere | alternating | EMPTY

where
   :variable=ref (sourceVariable | derivedVariable)
   :include
=> EMPTY

intersectWhere
   :variable=ref (sourceVariable | derivedVariable)
   :variable2=ref (sourceVariable | derivedVariable)
=> EMPTY

alternating => EMPTY

When union is present with intersect children, each of those children specifies a group of cells that should be styled, and the total group is all those cells taken together. When union is absent, every cell is styled. One attribute on setCellProperties affects the choice of cells:

Attribute: applyToConverse

If true, this inverts the meaning of the cell selection: the selected cells are the ones not designated. This is confusing, given the additional restrictions of union, but in the corpus applyToConverse is never present along with union.

An intersect specifies restrictions on the cells to be matched. Each where child specifies which values of a given variable to include. The attributes of intersect are:

Attribute: variable

Refers to a variable, e.g. dimension0categories. Only “categories” variables make sense here, but other variables, e.g. dimension0group0map, are sometimes seen. The reader may ignore these.

Attribute: include

A value, or multiple values separated by semicolons, e.g. 0 or 13;14;15;16.

PSPP ignores setCellProperties when intersectWhere is present.

What Styles?

setStyle
   :target=ref (labeling | graph | interval | majorTicks)
   :style=ref style
=> EMPTY

setMetaData :target=ref graph :key :value => EMPTY

setFormat
   :target=ref (majorTicks | labeling)
   :reset=bool?
=> format | numberFormat | stringFormat+ | dateTimeFormat | elapsedTimeFormat

setFrameStyle
   :style=ref style
   :target=ref majorTicks
=> EMPTY

The set* children of setCellProperties determine the styles to set.

When setCellProperties contains a setFormat whose target references a labeling element, or if it contains a setStyle that references a labeling or interval element, the setCellProperties sets the style for table cells. The format from the setFormat, if present, replaces the cells’ format. The style from the setStyle that references labeling, if present, replaces the label’s font and cell styles, except that the background color is taken instead from the interval’s style, if present.

When setCellProperties contains a setFormat whose target references a majorTicks element, or if it contains a setStyle whose target references a majorTicks, or if it contains a setFrameStyle element, the setCellProperties sets the style for row or column labels. In this case, the setCellProperties always contains a single where element whose variable designates the variable whose labels are to be styled. The format from the setFormat, if present, replaces the labels’ format. The style from the setStyle that references majorTicks, if present, replaces the labels’ font and cell styles, except that the background color is taken instead from the setFrameStyle’s style, if present.

When setCellProperties contains a setStyle whose target references a graph element, and one that references a labeling element, and the union element contains alternating, the setCellProperties sets the alternate foreground and background colors for the data area. The foreground color is taken from the style referenced by the setStyle that targets the graph, the background color from the setStyle for labeling.

A reader may ignore a setCellProperties that only contains setMetaData, as well as setMetaData within other setCellProperties.

A reader may ignore a setCellProperties whose only set* child is a setStyle that targets the graph element.

The setStyle Element

setStyle
   :target=ref (labeling | graph | interval | majorTicks)
   :style=ref style
=> EMPTY

This element associates a style with the target.

Attribute: target

The id of an element whose style is to be set.

Attribute: style

The id of a style element that identifies the style to set on the target.