3.8. OPT attributes
3.8.10. opt:single
3.8.9. opt:selector
« Previous
3.8.11. opt:use
Next »

3.8.10. opt:single

The attribute creates a single tag, causing its content to be lost. Its purpose is to close properly the HTML tags that are naturally single, like <img> in case we had to use some OPT instructions to perform some operations on them. Below, you can find an example:

<img src="image.png">
    <opt:attribute name="$imgExtraAttrName" value="$imgExtraValue" />
</img>

OPT will produce the following output for it:

<img src="image.png" someAttribute="someValue">
</img>

With opt:single we may force to create a single tag here and omit the content.

<img src="image.png" opt:single="yes">
    <opt:attribute name="$imgExtraAttrName" value="$imgExtraValue" />
</img>

The result:

<img src="image.png" someAttribute="someValue" />

See also:

3.8.10. opt:single
3.8. OPT attributes
« Previous
3.8.9. opt:selector
Next »
3.8.11. opt:use