]> Lady’s Gitweb - Shushe/commit
Add @书社:parsed-by to parse results
authorLady <redacted>
Thu, 18 Jan 2024 01:55:19 +0000 (20:55 -0500)
committerLady <redacted>
Thu, 18 Jan 2024 02:37:30 +0000 (21:37 -0500)
commit90810b4c234960e725e770f331b13c4687f407c8
tree85bd2bc38864b15505a58b6b450c068680968c15
parent1c02c25ab49b46225f48d51ccc52648c20c82eaf
Add @书社:parsed-by to parse results

This switches the parser to use a two‐stage parse, in which each node
is by default first processed in the `书社:parse` mode, which then
applies templates to the node. This provides a hook for selecting
certain kinds of elements, for example `<html:script>` elements, and
doing something to the result.

The “something” in this case is “making note of the parser which is
registered to that type on each result element by setting the
`@书社:parsed-by` attribute to its `@id`.

This setup also allows a reparsing of the parse result (in case new
`<html:script>` elements were produced by it); it is worth noting that
this could result in an endless loop if the `<html:script>` element is
not actually transformed by any parser.
README.markdown
lib/catalog2parser.xslt
This page took 0.079166 seconds and 4 git commands to generate.