Skip to content

Commit

Permalink
Render ldh:categoryVarName value as a multi-select
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 15, 2024
1 parent 93670ba commit a879e6f
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,29 @@ exclude-result-prefixes="#all">
</xsl:if>
</xsl:template>

<xsl:template match="ldh:categoryVarName/text() | ldh:categoryVarName/@rdf:nodeID[key('resource', .)/rdf:type/@rdf:resource = '&xsd;string']" mode="bs2:FormControl" priority="1">
<xsl:param name="type-label" select="true()" as="xs:boolean"/>
<xsl:variable name="this" select="../concat(namespace-uri(), local-name())" as="xs:string"/>
<xsl:variable name="properties" select="../../*[concat(namespace-uri(), local-name()) = $this]" as="element()*"/>
<xsl:variable name="value" select="." as="xs:string"/>

<select name="ou" id="{generate-id()}" multiple="multiple" size="{count($properties)}">
<xsl:for-each select="$properties">
<xsl:sort select="ac:label(.)" lang="{$ldt:lang}"/>

<option>
<xsl:if test="">
<xsl:with-param name="selected" select="text() = $value"/>
</xsl:if>

<xsl:value-of select="."/>
</option>
</xsl:for-each>
</select>

<xsl:if test="$type-label">
<xsl:apply-templates select="." mode="bs2:FormControlTypeLabel"/>
</xsl:if>
</xsl:template>

</xsl:stylesheet>

0 comments on commit a879e6f

Please sign in to comment.