Nested types
Previous  Top  Next

The nested types section provides meta-information about the set of item types that may occur as submodule elements.

Here's what it looks like for the example flavor com.headway.examples.html:

<
nested-types>
   <
nested-type name="anchor" icon="anchor.gif"/>
<
/nested-types>

Key points:
·Our html domain contains just one item at the submodule level, namely anchors.  
·The icon entry tells Structure101g to use the icon "anchor.gif" when rendering items of this type. In fact, this entry is redundant - in the absence of an explict icon declaration as above, Structure101g will always assume an icon "<typename>.gif" by default.  

Other domains will have multiple nested types. For example, the flavor com.headway.examples.osgi defines nested types for "package" and "extension", while com.headway.examples.xsl defines nested types for "match-template", "named-template" and "variable".

Some domains will have no nested types at all (e.g. a domain that only models C in terms of files and includes relationships).

But the same principles apply in all cases: this section tells Structure101g what items may occur at this level and (explicitly or implictly) controls the mapping between the logical type and a physical icon file.

If you have any nested items, Structure101g needs to know how to display their fully-qualified name. Consider the following data snippet (representing a html file called "aboutus/contact.html" that contains an anchor item called "a1"):

<
item name="aboutus/contact.html" id="3" type="file">
   <
item name="a1" id="4" type="anchor"/>
<
/item>

By default, Structure101g will deem the full name of "a1" to be "aboutus/contact.html/a1". That is, it takes the full name of the module item and then recursively adds separator character and local name for each level of nesting. By default, it uses the same separator as defined for module-type. However, sometimes it is preferable to specify an alternative string. In the world of HTML files and anchors, the natural candidate is '#'.

<nested-types sep="#">
   <
nested-type name="anchor" icon="anchor.gif"/>
<
/nested-types>

With this modified declaration in place, the fully qualified name of our "a1" anchor will now be "aboutus/contact.html#a1".