The main goal of this commit was to add a
`<书社:apply-attributes-to-root>` element, to allow transforms to pass
attributes up to the root element of the result, for example `@lang`
information. This required an extensive refactor of a lot of the
transform infrastructure and the creation of a new transform stage,
`书社:application`, which follows the ordinary transform and solely
handles `<书社:apply-attributes-to-root>` and
`<书社:apply-attributes>`. Other `@书社:*` attributes are removed at
this stage, but it isn’t generally recommended that transforms try to
hook in here.
This commit also makes a number of smaller changes :—
- Use `node()` in place of element wildcards anywhere where
specifically only matching elements wasn’t intended.
In particular, even in places where text is not expected, there may
be comments to preserve.
- Only add `@itemscope` and `@itemtype` attributes to H·T·M·L elements,
since they are only defined for elements in that namespace.
- Provide `@书社:identifier` on documents and embeds to get the
`about:shushe` u·r·i of the resource.
- In transforms which generate transforms, `<xsla:text>` elements which
provide only white·space need `<xslt:text>` children to ensure the
whitespace isn’t stripped. (Note: In the actual source text, `xsla:`
is given the `xslt:` prefix and `xslt:` is the default prefix.)
Similarly, it’s necessary to provide attribute value templates using
a `<xslt:attribute>` element rather than with the literal result
element syntax, to prevent them from being prematurely applied.