Selection context example
The following graphic illustrates the report used to
create the sample selection context instance that follows.

This sample XML is the selection context that corresponds to the highlighted cell.
<s:selection
rModel="MP_0" xmlns:s="http://developer.cognos.com/schemas/selection/1/"
rSelectedCells="C_0">
<s:metadataCells>
<s:metadataCell xml:id="M_0" rQueryName="QN_0" rName="N_0" rExpression="QI_0"
rType="T_0" rUsage="U_0"/>
<s:metadataCell xml:id="M_1" rName="N_1" rExpression="QI_1"
rType="T_0" rUsage="U_1"/>
<s:metadataCell xml:id="M_2" rName="N_2" rExpression="QI_2"
rType="T_0" rUsage="U_1"/>
<s:metadataCell xml:id="M_3" rName="N_3" rType="T_1"/>
<s:metadataCell xml:id="M_4" rName="N_3" rType="T_1"/>
<s:metadataCell xml:id="M_5" rName="N_4" rExpression="QI_3"
rType="T_0" rUsage="U_1"/>
<s:metadataCell xml:id="M_6" rName="N_3" rType="T_1"/>
<s:metadataCell xml:id="M_7" rName="N_3" rType="T_1"/>
</s:metadataCells>
<s:cells>
<s:cell xml:id="C_0" rMetadataCell="M_0" rValue="V_0">
<s:dependentCells>
<s:cell xml:id="C_7" rMetadataCell="M_7" rValue="V_7"/>
</s:dependentCells>
<s:definingCells>
<s:axis rCell="C_1"/>
<s:axis rCell="C_5"/>
</s:definingCells>
</s:cell>
<s:cell xml:id="C_1" rMetadataCell="M_1" rValue="V_1">
<s:dependentCells>
<s:cell xml:id="C_4" rMetadataCell="M_4" rValue="V_4"/>
</s:dependentCells>
<s:definingCells>
<s:axis rCell="C_2"/>
</s:definingCells>
</s:cell>
<s:cell xml:id="C_2" rMetadataCell="M_2" rValue="V_2">
<s:dependentCells>
<s:cell xml:id="C_3" rMetadataCell="M_3" rValue="V_3"/>
</s:dependentCells>
</s:cell>
<s:cell xml:id="C_5" rMetadataCell="M_5" rValue="V_5">
<s:dependentCells>
<s:cell xml:id="C_6" rMetadataCell="M_6" rValue="V_6"/>
</s:dependentCells>
</s:cell>
</s:cells>
<s:strings>
<s:s xml:id="QN_0">Query1</s:s>
<s:s xml:id="N_0">Return quantity</s:s>
<s:s xml:id="N_1">Product type</s:s>
<s:s xml:id="N_2">Product line</s:s>
<s:s xml:id="N_3">_memberCaption</s:s>
<s:s xml:id="N_4">Year</s:s>
<s:s xml:id="T_0">memberUniqueName</s:s>
<s:s xml:id="T_1">_memberCaption</s:s>
<s:s xml:id="V_0">[Returned items (analysis)].[Returned items].[Return quantity]
</s:s>
<s:s xml:id="V_1">[Product forecast (analysis)].[Product].[Product].[Product
type]->[all].[991].[953]</s:s>
<s:s xml:id="V_2">[Product forecast (analysis)].[Product].[Product].[Product
line]->[all].[991]</s:s>
<s:s xml:id="V_3">Camping Equipment</s:s>
<s:s xml:id="V_4">Sleeping Bags</s:s>
<s:s xml:id="V_5">[Product forecast (analysis)].[Time dimension].
[Time dimension].[Year]->[all].[2005]</s:s>
<s:s xml:id="V_6">2005</s:s>
<s:s xml:id="V_7">8281</s:s>
<s:s xml:id="QI_0">
[Returned items (analysis)].[Returned items].[Return quantity]
</s:s>
<s:s xml:id="QI_1">
[Product forecast (analysis)].[Product].[Product].[Product type]
</s:s>
<s:s xml:id="QI_2">
[Product forecast (analysis)].[Product].[Product].[Product line]
</s:s>
<s:s xml:id="QI_3">
[Product forecast (analysis)].[Time dimension].[Time dimension].
[Year]</s:s>
<s:s xml:id="U_0">measure</s:s>
<s:s xml:id="U_1">nonMeasure</s:s>
<s:s xml:id="MP_0">/content/folder[@name='Samples']
/folder[@name='Models']/package[@name='GO
Sales (analysis)']/model[@name='model']</s:s>
</s:strings>
</s:selection>
Each selection context instance has three main parts. The first
section, <metadataCells>
, defines the metadata
associated with the selected and dependent cells. The second section, <cells>
,
defines the selected cells, including the dependent and defining
cells. The third section, <strings>
, contains
the strings that are re-used throughout the selection context.