Containers

Containers is a way to limit area of usage of some style/scope/label by specific parent (surrounding) style.

The logic is following:

  1. You have styles. Styles are described by Blocks, Keywords, and Words conditions and applied to some interval of the text (text block).
  2. Styles can be referred by style id. If id attribute is not defined HippoEDIT will use value of name attribute as id.
  3. When you define container (or containers) for Scope or another schema object, you allow this Scope, Style or Label etc to be recognized only in the style specified by container id.

For example this mean:

<Scope open="{" close="}">
   <containers open="test_container_name"/>
</Scope>

Scope with open tag “{” allowed only in the style “test_container_name”. If it would be found in some other style, it would be skipped. If you do not specify containers, HippoEDIT assumes that this object (scope, style or label) allowed only in normal style (style with id = normal, defined in def_spec.xml).

For objects as Scope and Style you can define containers for open part and for close part (for scopes also for middle part). For example CSS block in HTML can be started in normal style of HTML code and can be closed inside CSS normal or comment style.

<Containers>
   <Close id="css:normal"/>
   <Close id="css:comment"/>
</Containers>

If you do not define an open container, it would be normal style of current language. By default, all styles without Container node (Open or Close) implicitly allowed to be located inside a normal style. If you define a Container node, you implicitly overwrite such assignment and allow usage of the style only inside of container explicitly specified. If you want the style to still be allowed inside of normal style, you need to add normal to list of allowed containers.

If you want to refer to a style from another syntax schema, you can do this as well, by giving syntax id before style id separated with “:” :

<Style id="style" name="CSS" include="css:normal" ...

This is including of the CSS block in HTML syntax schema.