to the main page... about these slides...

Context patterns

- can be used to make defaults, constraints, and content descriptions context dependent.

(The context of a node is its sequence of ancestors.)

A context expression is a sequence of context terms:

 contextexp  ->  contextterm*
It matches a context if the context can be decomposed into consecutive fragments, each matched by a context term.

A context term either matches an arbitrary fragment or a single element:

 contextterm  -> <SomeElements/> | 
                 <Element (IDRef="element ID" | Name="element name")?>
                   attributedescr*
                 </Element>
(Context expressions always implicitly start with a <SomeElements/>.)

DSD context patterns are reminiscent of CSS selectors.


Examples: