Skip to content

Commit

Permalink
Fix handling of external JSON-LD generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr committed Mar 22, 2024
1 parent 4189504 commit 181ed57
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
22 changes: 22 additions & 0 deletions suse2022-ns/xhtml/chunk.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,26 @@

<xsl:param name="is.chunk" select="1"/>


<xsl:template match="/">
<xsl:apply-imports/>
<xsl:choose>
<xsl:when test="$dcfilename != ''">
<xsl:call-template name="generate-json-ld-external">
<xsl:with-param name="node" select="." />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="log.message">
<xsl:with-param name="level">WARN</xsl:with-param>
<xsl:with-param name="context-desc">
<xsl:text>JSON-LD</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>The parameter $dcfilename is unset. Cannot create the external JSON file.</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
9 changes: 5 additions & 4 deletions suse2022-ns/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,11 @@


<!-- ############################################################## -->

<xsl:template match="/" mode="process.root">
<!-- This template is called when creating single HTML -->
<xsl:template match="/">
<xsl:apply-imports/>
<xsl:choose>
<xsl:if test="$is.chunk = 0">
<xsl:choose>
<xsl:when test="$dcfilename != ''">
<xsl:call-template name="generate-json-ld-external">
<xsl:with-param name="node" select="." />
Expand All @@ -722,6 +723,7 @@
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>

<xsl:template match="*" mode="process.root">
Expand Down Expand Up @@ -1026,5 +1028,4 @@ if (window.location.protocol.toLowerCase() != 'file:') {
</aside>
</xsl:template>


</xsl:stylesheet>

0 comments on commit 181ed57

Please sign in to comment.