XSLT examlpe

This commit is contained in:
Simon Martens
2024-12-28 08:15:55 +01:00
parent 60649ca2f4
commit 58df7cc1cb
25 changed files with 3049 additions and 48 deletions

View File

@@ -66,8 +66,12 @@
<div>
{{ range $_, $w := $a.Works }}
{{- if ne (len $w.Citation.InnerXML ) 0 -}}
<div>
{{- $w.Citation.InnerXML -}}
<div hx-ext="client-side-templates">
<div xslt-template="citation-xslt" xslt-onload>
<xml>
{{- Safe $w.Citation.InnerXML -}}
</xml>
</div>
</div>
{{- end -}}
{{ end }}
@@ -89,3 +93,5 @@
{{ end }}
{{ end }}
{{ end }}
{{ template "_xslt_citation" . }}

View File

@@ -0,0 +1,15 @@
<script id="citation-xslt" type="application/xml">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="title">
<em>
<xsl:apply-templates />
</em>
</xsl:template>
<xsl:template match="year">
<span class="">
<xsl:apply-templates />
</span>
</xsl:template>
</xsl:stylesheet>
</script>