]> Lady’s Gitweb - Shushe/commitdiff
Allow injecting raw output in X·M·L serialization 0.7.2
authorLady <redacted>
Sun, 14 Apr 2024 23:38:07 +0000 (19:38 -0400)
committerLady <redacted>
Sun, 14 Apr 2024 23:43:06 +0000 (19:43 -0400)
It’s not possible to serialize things like entities using the normal
X·S·L·T processes. With this commit, one can instead use something like
`<书社:raw-output>&amp;my-entity;</书社:raw-output>` inside of
`<书社:serialize-xml>` elements to get this result.

README.markdown
lib/catalog2transform.xslt
lib/serialize.xslt
transforms/serialization.xslt

index 643a4d8da36c3e470ddc197cc5f008b9e1b76404..8a0ebe1c26a8889c5a8112b553980eb277d7150a 100644 (file)
@@ -75,7 +75,7 @@ Compilation involves the following steps :⁠—
 
 6. ⛩️📰 书社 compiles each output file to `build/result`.
 
-7. ⛩️📰 书社 symlinks most output files from `build/result` to
+7. ⛩️📰 书社 copies most output files from `build/result` to
      `build/public`, but it does some additional processing instead on
      those which indicate a non‐X·M·L desired final output form.
 
@@ -459,6 +459,10 @@ Transforms are used to convert X·M·L files into their final output,
   It is not possible to selectively only declare one prefix for a
     name·space to the exclusion of others.
 
+  `<书社:raw-output>` elements may be used inside of
+    `<书社:serialize-xml>` elements to inject raw output into the
+    serialized X·M·L.
+
 The following are recommendations on effective creation of
   transforms :⁠—
 
index 2b5c417365346b8c77d613c6eb94aa4aebe874dd..04c38f97885247858d7bc0f887aa77193a09b9c0 100644 (file)
@@ -389,7 +389,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        <xslt:template match="text()" mode="书社:header"/>
                        <xslt:template match="text()" mode="书社:footer"/>
                        <xslt:template match="text()" mode="书社:metadata"/>
-                       <xslt:output method="xml" encoding="UTF-8" cdata-section-elements="html:script html:style html:textarea 书社:raw-text"/>
+                       <xslt:output method="xml" encoding="UTF-8" cdata-section-elements="html:script html:style html:textarea 书社:raw-output 书社:raw-text"/>
                </xslt:transform>
        </template>
        <output method="xml" encoding="UTF-8"/>
index 5f792ea57269094a2d1c4b8a7a1d4bbe6a801629..4c3e84e92056df9ae6fc994f7c3eb369794d0ff9 100644 (file)
@@ -123,7 +123,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        <with-param name="source" select="string($source)"/>
                </call-template>
        </template>
-       <template match="node()" mode="书社:serialize">
+       <template match="node()" mode="书社:serialize" priority="0">
                <param name="namespace" select="''"/>
                <param name="declare-namespaces" select="''"/>
                <param name="prefix-map">
index 09f595eae627ef285f648acbd0b6b887dae38183..6d6dacddf03c4bce6e0bd98a9e46b0dc8f16e461 100644 (file)
@@ -64,4 +64,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </with-param>
                </apply-templates>
        </template>
+       <template match="书社:raw-output" mode="书社:serialize" priority="1">
+               <copy-of select=".//text()"/>
+       </template>
 </transform>
This page took 0.066717 seconds and 4 git commands to generate.