Skip to content

Commit 7375d30

Browse files
committed
Create productname context with isPartOf
1 parent ad8237e commit 7375d30

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

suse2022-ns/xhtml/json-ld.xsl

+16-2
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@
480480
</xsl:template>
481481

482482
<xsl:template name="json-ld-dateModified">
483+
<xsl:param name="node" select="."/>
483484
<xsl:variable name="candidate-date">
484485
<xsl:choose>
485486
<xsl:when test="function-available('date:date-time') or
@@ -549,7 +550,7 @@
549550
</xsl:if>
550551
</xsl:template>
551552

552-
<!-- -->
553+
<!-- The following templates access the Docserv config -->
553554
<xsl:template name="json-ld-version">
554555
<xsl:param name="node" select="."/>
555556
<xsl:variable name="productnumber" select="($node/d:info/d:productnumber)"/>
@@ -569,13 +570,26 @@
569570
</xsl:call-template>
570571
</xsl:variable>
571572
<xsl:variable name="product">
573+
<xsl:for-each select="$stitchxml">
574+
<xsl:value-of select="key('dcfiles', $dcfile)/ancestor::product/name"/>
575+
</xsl:for-each>
576+
</xsl:variable>
577+
<xsl:variable name="acronym">
572578
<xsl:for-each select="$stitchxml">
573579
<xsl:value-of select="key('dcfiles', $dcfile)/ancestor::product/acronym"/>
574580
</xsl:for-each>
575581
</xsl:variable>
576582

577583
<xsl:if test="$product != ''">
578-
"name": "<xsl:value-of select="$product"/>",
584+
"isPartOf": {
585+
"@type": "CreativeWorkSeries",
586+
"name": "<xsl:value-of select="$product"/>"<xsl:if test="$acronym != ''">
587+
<xsl:text>,&#10;</xsl:text>
588+
<xsl:text> "alternateName": "</xsl:text>
589+
<xsl:value-of select="$acronym"/>
590+
<xsl:text>"</xsl:text>
591+
</xsl:if>
592+
},
579593
</xsl:if>
580594
</xsl:template>
581595

0 commit comments

Comments
 (0)