]> Lady’s Gitweb - Shushe/commit
Refactor transforms & add 书社:application stage 0.6.0
authorLady <redacted>
Thu, 8 Feb 2024 03:41:33 +0000 (22:41 -0500)
committerLady <redacted>
Thu, 8 Feb 2024 03:54:13 +0000 (22:54 -0500)
commitc00fbad125caaac8be191801ca47a6971007fbad
treecfa176d76016eb32e52db04a3f0aaf538f01cf1b
parentd64d93fe12371f87cc42d72e7e874115b28fb252
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, `<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.
GNUmakefile
README.markdown
lib/catalog2parser.xslt
lib/catalog2transform.xslt
transforms/asset.xslt
transforms/attributes.xslt [deleted file]
This page took 0.027538 seconds and 4 git commands to generate.