summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2023-01-17 18:25:26 +0900
committerJinWang An <jinwang.an@samsung.com>2023-01-17 18:25:26 +0900
commit1a05477c16fcb1acba3a1b0bf0317b2424b944e0 (patch)
treef19258483d5296f8591959414a17b623c599b669
parent01d94681c60d92c1890a883387ccc495c9d3b7a1 (diff)
downloaddocbook-xsl-stylesheets-upstream.tar.gz
docbook-xsl-stylesheets-upstream.tar.bz2
docbook-xsl-stylesheets-upstream.zip
Imported Upstream version 20200603upstream/20200603upstream
-rw-r--r--xsl/fo/axf.xsl9
-rw-r--r--xsl/fo/docbook.xsl4
-rw-r--r--xsl/fo/fop1.xsl5
-rw-r--r--xsl/fo/highlight.xsl79
-rw-r--r--xsl/fo/xep.xsl5
-rw-r--r--xsl/fo/xref.xsl6
-rw-r--r--xsl/highlighting/common.xsl5
-rw-r--r--xsl/html/graphics.xsl1
-rw-r--r--xsl/html/xref.xsl6
9 files changed, 92 insertions, 28 deletions
diff --git a/xsl/fo/axf.xsl b/xsl/fo/axf.xsl
index c9e245e..6c6b4e8 100644
--- a/xsl/fo/axf.xsl
+++ b/xsl/fo/axf.xsl
@@ -55,7 +55,10 @@
<xsl:element name="axf:document-info">
<xsl:attribute name="name">keywords</xsl:attribute>
<xsl:attribute name="value">
- <xsl:for-each select="//d:keyword">
+ <xsl:for-each
+ select="//d:keyword[normalize-space(.) != '']
+ [count(. | key('keywords', normalize-space(.))[1]) = 1]">
+ <xsl:sort select="normalize-space(.)"/>
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
@@ -79,8 +82,12 @@
</xsl:element>
</xsl:if>
+ <xsl:call-template name="user-axf-document-information" />
+
</xsl:template>
+<xsl:template name="user-axf-document-information" />
+
<!-- These properties are added to fo:simple-page-master -->
<xsl:template name="axf-page-master-properties">
<xsl:param name="page.master" select="''"/>
diff --git a/xsl/fo/docbook.xsl b/xsl/fo/docbook.xsl
index 2c126a3..904704b 100644
--- a/xsl/fo/docbook.xsl
+++ b/xsl/fo/docbook.xsl
@@ -91,6 +91,10 @@
<xsl:key name="id" match="*" use="@id|@xml:id"/>
+<xsl:key name="keywords"
+ match="d:keyword[normalize-space(.) != '']"
+ use="normalize-space(.)" />
+
<!-- ==================================================================== -->
<xsl:template match="*">
diff --git a/xsl/fo/fop1.xsl b/xsl/fo/fop1.xsl
index d501f58..955b517 100644
--- a/xsl/fo/fop1.xsl
+++ b/xsl/fo/fop1.xsl
@@ -202,7 +202,10 @@
<!-- Keywords -->
<xsl:if test="//d:keyword">
<pdf:Keywords>
- <xsl:for-each select="//d:keyword">
+ <xsl:for-each
+ select="//d:keyword[normalize-space(.) != '']
+ [count(. | key('keywords', normalize-space(.))[1]) = 1]">
+ <xsl:sort select="normalize-space(.)"/>
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
diff --git a/xsl/fo/highlight.xsl b/xsl/fo/highlight.xsl
index cf0812d..98f8242 100644
--- a/xsl/fo/highlight.xsl
+++ b/xsl/fo/highlight.xsl
@@ -16,28 +16,78 @@
<xsl:import href="../highlighting/common.xsl"/>
+<xsl:attribute-set name="highlight.keyword.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.string.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="font-style">italic</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.comment.properties">
+ <xsl:attribute name="font-style">italic</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.tag.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.attribute.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.value.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.number.properties" />
+
+<xsl:attribute-set name="highlight.annotation.properties">
+ <xsl:attribute name="color">gray</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="highlight.directive.properties" />
+
+<xsl:attribute-set name="highlight.doccomment.properties">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+
<xsl:template match='xslthl:keyword' mode="xslthl">
- <fo:inline font-weight="bold"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.keyword.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:string' mode="xslthl">
- <fo:inline font-weight="bold" font-style="italic"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.string.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:comment' mode="xslthl">
- <fo:inline font-style="italic"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.comment.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:tag' mode="xslthl">
- <fo:inline font-weight="bold"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.tag.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:attribute' mode="xslthl">
- <fo:inline font-weight="bold"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.attribute.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:value' mode="xslthl">
- <fo:inline font-weight="bold"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.value.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<!--
@@ -55,22 +105,29 @@
-->
<xsl:template match='xslthl:number' mode="xslthl">
- <xsl:apply-templates mode="xslthl"/>
+ <fo:inline xsl:use-attribute-sets="highlight.number.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:annotation' mode="xslthl">
- <fo:inline color="gray"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.annotation.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<xsl:template match='xslthl:directive' mode="xslthl">
- <xsl:apply-templates mode="xslthl"/>
+ <fo:inline xsl:use-attribute-sets="highlight.directive.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
<!-- Not sure which element will be in final XSLTHL 2.0 -->
<xsl:template match='xslthl:doccomment|xslthl:doctype' mode="xslthl">
- <fo:inline font-weight="bold"><xsl:apply-templates mode="xslthl"/></fo:inline>
+ <fo:inline xsl:use-attribute-sets="highlight.doccomment.properties">
+ <xsl:apply-templates mode="xslthl"/>
+ </fo:inline>
</xsl:template>
</xsl:stylesheet>
-
diff --git a/xsl/fo/xep.xsl b/xsl/fo/xep.xsl
index 15fad6a..ffbc35c 100644
--- a/xsl/fo/xep.xsl
+++ b/xsl/fo/xep.xsl
@@ -77,7 +77,10 @@
<xsl:element name="rx:meta-field">
<xsl:attribute name="name">keywords</xsl:attribute>
<xsl:attribute name="value">
- <xsl:for-each select="//d:keyword">
+ <xsl:for-each
+ select="//d:keyword[normalize-space(.) != '']
+ [count(. | key('keywords', normalize-space(.))[1]) = 1]">
+ <xsl:sort select="normalize-space(.)"/>
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
diff --git a/xsl/fo/xref.xsl b/xsl/fo/xref.xsl
index 0996bec..153a708 100644
--- a/xsl/fo/xref.xsl
+++ b/xsl/fo/xref.xsl
@@ -351,7 +351,7 @@
</xsl:apply-templates>
</xsl:template>
-<xsl:template match="d:author|d:editor|d:othercredit|d:personname" mode="xref-to">
+<xsl:template match="d:author|d:editor|d:othercredit|d:personname" mode="xref-to" priority="1">
<xsl:param name="referrer"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="verbose" select="1"/>
@@ -546,10 +546,6 @@
</xsl:choose>
</xsl:template>
-<xsl:template match="d:glossterm|d:firstterm" mode="xref-to">
- <xsl:apply-templates mode="no.anchor.mode"/>
-</xsl:template>
-
<xsl:template match="d:index" mode="xref-to">
<xsl:param name="referrer"/>
<xsl:param name="xrefstyle"/>
diff --git a/xsl/highlighting/common.xsl b/xsl/highlighting/common.xsl
index 6d46224..5c0a5c0 100644
--- a/xsl/highlighting/common.xsl
+++ b/xsl/highlighting/common.xsl
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
- xmlns:s6hl="http://net.sf.xslthl/ConnectorSaxon6"
+ xmlns:s6hl="java:net.sf.xslthl.ConnectorSaxon6"
xmlns:sbhl="http://net.sf.xslthl/ConnectorSaxonB"
xmlns:xhl="http://net.sf.xslthl/ConnectorXalan"
xmlns:saxon6="http://icl.com/saxon"
@@ -25,9 +25,6 @@
<xalan:script lang="javaclass" src="xalan://net.sf.xslthl.ConnectorXalan" />
</xalan:component>
-<!-- for saxon 6 -->
-<saxon6:script implements-prefix="s6hl" language="java" src="java:net.sf.xslthl.ConnectorSaxon6" />
-
<!-- for saxon 8.5 and later -->
<saxonb:script implements-prefix="sbhl" language="java" src="java:net.sf.xslthl.ConnectorSaxonB" />
diff --git a/xsl/html/graphics.xsl b/xsl/html/graphics.xsl
index 434c29a..039fdc5 100644
--- a/xsl/html/graphics.xsl
+++ b/xsl/html/graphics.xsl
@@ -67,6 +67,7 @@
or $lcext = 'ogv'
or $lcext = 'ogg'
or $lcext = 'webm'
+ or $lcext = 'webp'
or $lcext = 'bmp'">1</xsl:if>
</xsl:template>
diff --git a/xsl/html/xref.xsl b/xsl/html/xref.xsl
index 4d35222..d282331 100644
--- a/xsl/html/xref.xsl
+++ b/xsl/html/xref.xsl
@@ -400,7 +400,7 @@
</xsl:apply-templates>
</xsl:template>
-<xsl:template match="d:author|d:editor|d:othercredit|d:personname" mode="xref-to">
+<xsl:template match="d:author|d:editor|d:othercredit|d:personname" mode="xref-to" priority="1">
<xsl:param name="referrer"/>
<xsl:param name="xrefstyle"/>
@@ -592,10 +592,6 @@
</xsl:choose>
</xsl:template>
-<xsl:template match="d:glossterm|d:firstterm" mode="xref-to">
- <xsl:apply-templates mode="no.anchor.mode"/>
-</xsl:template>
-
<xsl:template match="d:index" mode="xref-to">
<xsl:param name="referrer"/>
<xsl:param name="xrefstyle"/>