Appendix C. Schema shortcuts

There is often more than one way to write something in Mondrian’s XML schema format. Mondrian provides shortcuts to allow you to write concise XML. These are particularly useful if you’re writing XML by hand.

Name

Example

Attribute.nameColumn default An attribute’s name defaults to its key (if the key has a single column) or the last column of its key (if the key is a composite). For example, <Attribute name='Year' keyColumn='year'/> is equivalent to <Attribute name='Year' keyColumn='year'
nameColumn='year'/>
Attribute.keyColumn for Attribute.Key If an attribute’s key is a single column, you can use the keyColumn attribute. For example, <Attribute name='Year' keyColumn='year'/> is equivalent to <Attribute name='Year'>
<Key>
<Column name='year'/>
</Key>
</Attribute>
Attribute.nameColumn for Attribute.Name If an attribute’s name is a column (not an expression), you can use the nameColumn attribute. For example, <Attribute name='Day' ... nameColumn='day_
of_month'/> is shorthand for <Attribute name='Day' ...>
<Name>
<Column name='day_of_month'/>
</Name>
</Attribute>
Default table for hierarchy The attribute Hierarchy.table lets you omit the Column.table attribute in all enclosed elements.
Default table for level The attribute Level.table lets you omit the Column.table attribute for all enclosed elements.
Attribute.ordinalColumn default If you don’t specify an ordinal expression, it defaults to the name. For example, <Attribute name='Product Name'
keyColumn='product_id'
nameColumn='product_name'/> is shorthand for <Attribute name='Product Name'
keyColumn='product_id'
nameColumn='product_name' ordinalColumn=
'product_name'/>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset