Skip to content

Commit

Permalink
Integrate json-ld-productname
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr committed Jan 30, 2024
1 parent 7f4003a commit eea06b0
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion suse2022-ns/xhtml/json-ld.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,14 @@
<xsl:call-template name="json-ld-dateModified">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="json-ld-category">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<!-- Belongs to type "SoftwareApplication" -->
<xsl:call-template name="json-ld-version">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="json-ld-category">
<xsl:call-template name="json-ld-productname">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>

Expand Down Expand Up @@ -494,4 +498,22 @@
</xsl:if>
</xsl:template>

<xsl:template name="json-ld-productname">
<xsl:param name="node" select="."/>
<xsl:variable name="dcfile">
<xsl:call-template name="get-dc-filename">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="product">
<xsl:for-each select="$stitchxml">
<xsl:value-of select="key('dcfiles', $dcfile)/ancestor::product/acronym"/>
</xsl:for-each>
</xsl:variable>

<xsl:if test="$product != ''">
"name": "<xsl:value-of select="$product"/>",
</xsl:if>
</xsl:template>

</xsl:stylesheet>

0 comments on commit eea06b0

Please sign in to comment.