From: Lady Date: Thu, 8 Feb 2024 03:41:33 +0000 (-0500) Subject: Refactor transforms & add 书社:application stage X-Git-Tag: 0.6.0^0 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/c00fbad125caaac8be191801ca47a6971007fbad?ds=inline;hp=c00fbad125caaac8be191801ca47a6971007fbad Refactor transforms & add 书社:application stage 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, `` elements which provide only white·space need `` 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 `` element rather than with the literal result element syntax, to prevent them from being prematurely applied. ---