diff --git a/scenarios/xslt/edxml2html/libs/html-shared-templates.xsl b/scenarios/xslt/edxml2html/libs/html-shared-templates.xsl new file mode 100644 index 0000000000000000000000000000000000000000..75fbfc79db0bae296b85f42e39b4a8ef597e98c6 --- /dev/null +++ b/scenarios/xslt/edxml2html/libs/html-shared-templates.xsl @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="xs" + version="2.0" xpath-default-namespace="http://sub.uni-goettingen.de/edxml#"> + + <!-- Highlightings --> + + <xsl:template match="hi[@rend='italics']|hi[not(@rend)]"> + <span class="hi italics" + id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </span> + </xsl:template> + + <xsl:template match="hi[@rend='bold']"> + <span class="hi bold" + id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </span> + </xsl:template> + + <xsl:template match="hi[@rend='sub']"> + <sub class="hi sub" + id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </sub> + </xsl:template> + + <xsl:template match="hi[@rend='super']"> + <sup class="hi sup" + id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </sup> + </xsl:template> + + <xsl:template match="hi[@rend='under']"> + <span class="hi under" + id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </span> + </xsl:template> + + <!-- Paragraphs --> + + <xsl:template match="p"> + <p id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}"> + <xsl:apply-templates/> + </p> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file