Matching a Border by Value

Syntax:

<border type="border-type" value="value" label="legend-label"/>
<border value="value" label="legend-label"viewBox="coords"> … SVG …</border>

Example: <border value="CR" type="box-clipRB" label="Common Replace&#xad;able"/>

Use: Defines a shape to use when an aspect of a component matches the specific value.

A border is used for a component if the value attribute matches the value at the XPath specified in the parent border’s use attribute. For example, if the borders element is:

<borders use="s12/@osd">
<border value="OS" type="box-clipTL"/>
<border value="CS" type="box-clipLB"/>

That means that when determining the shape, it must look at the value of the osd attribute of the contained s12 element.

<component …>…
<s12 osd="OS"/> …
</component>

In this case, the value of osd is OS, which means it matches the first border element. This gives the component a border shape of box-clipTL, that is, a square with the top-left corner clipped off.

A border element can also explicitly define the shape, rather than using one of the pre-defined types. This is done by not specifying a type and including the shape definition as SVG inside the border element. For example, the above example can be specified entirely using SVG in the following way:

<borders use="s12/@osd">
<border value="OS" viewBox="0 0 20 20">
<svg:path d="M 5 0 L 0 5 L 0 20 L 20 20 L 20 0 z" stroke="black"/>
</border>
<border value="CS" viewBox="0 0 20 20">
<svg:path d="M 0 0 L 0 15 L 5 20 L 20 20 L 20 0 z" stroke="black"/>
</border>