From c61c544d732fb818d872313b9124c7cd5f375d46 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Tue, 3 Dec 2024 17:47:54 +0000 Subject: [PATCH] Support different options for dealing with unhandled elements --- src/guide/xml/ref-modes.xml | 22 ++++++++ src/guide/xml/ref-params.xml | 49 +++++++++++++++++ src/main/scss/media-all.scss | 13 ++++- src/main/xslt/modules/unhandled.xsl | 84 +++++++++++++---------------- 4 files changed, 120 insertions(+), 48 deletions(-) diff --git a/src/guide/xml/ref-modes.xml b/src/guide/xml/ref-modes.xml index a0e5054f78..7ca640d33e 100644 --- a/src/guide/xml/ref-modes.xml +++ b/src/guide/xml/ref-modes.xml @@ -2030,5 +2030,27 @@ Be aware, however, that the HTML markup is quite constrained for panel sets. + + + +m:unhandled +{http://docbook.org/ns/docbook/modes}unhandled +2.5.1 + + +m:unhandled +Process unhandled elements +mode + + +Description +When on-unhandled-elements is set to custom, +elements with no other matching template will be processed in this mode. Note that +there are no templates in this mode in the standard stylesheets. This is an extensibility +point for customization layers. + + + + diff --git a/src/guide/xml/ref-params.xml b/src/guide/xml/ref-params.xml index ca8e3561f8..626087b6f5 100644 --- a/src/guide/xml/ref-params.xml +++ b/src/guide/xml/ref-params.xml @@ -5898,4 +5898,53 @@ unless a processing instruction overrides it. + + + + xs:string + on-unhandled-elements + 'fail' + + 2.5.1 + + + How to process unhandled elements + + +Description + +This parameter controls how unhandled elements (for example, extension +elements added in a custom schema) should be processed. + + + + +terminate + + +Generates an error messages and aborts the transformation. + + + + +render + + +Renders the tag name in the output, styled in red and yellow. + + + + +custom + + +Processes the template in the m:unhandled mode. These must be defined +in a customization layer; there are no templates in this mode in the standard stylesheets. + + + + + + + diff --git a/src/main/scss/media-all.scss b/src/main/scss/media-all.scss index 56f0178190..432c5b36de 100644 --- a/src/main/scss/media-all.scss +++ b/src/main/scss/media-all.scss @@ -12,7 +12,7 @@ --on-primary-color: #ffffff; --on-primary-variant-color: #ffffff; --on-secondary-color: #000000; - --on-error-color: #000000; + --on-error-color: #ffee42; --enabled-color: rgb(240,240,240); --hovered-color: rgb(235,235,235); --focused-color: rgb(221,221,221); @@ -201,6 +201,17 @@ span.error.broken-link::after { content: " 🔗 "; } +.unhandled { + font-family: monospace; + background-color: var(--error-border-color); + color: var(--on-error-color); + font-weight: bold; +} + +div.unhandled { + width: 100%; +} + .firstterm { font-weight: bold; } diff --git a/src/main/xslt/modules/unhandled.xsl b/src/main/xslt/modules/unhandled.xsl index 333b1f2adf..6efae7790b 100644 --- a/src/main/xslt/modules/unhandled.xsl +++ b/src/main/xslt/modules/unhandled.xsl @@ -9,53 +9,43 @@ version="3.0"> - - - - - - - - - - - < - - > - - - - - - - </ - - > - - - - + + + + + + + + + + + + + + < + + > + + + + + + + </ + + > + + + + + + +