File: 171_fix-null-attributes-causing-IllegalArgumentException.patch

package info (click to toggle)
dita-ot 1.5.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,296 kB
  • sloc: xml: 29,334; java: 24,201; javascript: 1,299; makefile: 45
file content (34 lines) | stat: -rw-r--r-- 1,945 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Author: Tj <debian@iam.tj>
Last-Update: 2025-08-16
Forwarded: not-needed
Description: Fix IllegalArgumentExceptions due to null values

diff --git a/demo/fo/cfg/fo/attrs/commons-attr.xsl b/demo/fo/cfg/fo/attrs/commons-attr.xsl
index 820c0af80..96ff4232b 100644
--- a/demo/fo/cfg/fo/attrs/commons-attr.xsl
+++ b/demo/fo/cfg/fo/attrs/commons-attr.xsl
@@ -646,8 +646,8 @@ See the accompanying license.txt file for applicable licenses.
 
     <xsl:attribute-set name="__fo__root" use-attribute-sets="base-font">
         <xsl:attribute name="font-family">serif</xsl:attribute>
-        <xsl:attribute name="xml:lang" select="translate($locale, '_', '-')"/>
-        <xsl:attribute name="writing-mode" select="$writing-mode"/>
+        <xsl:attribute name="xml:lang"><xsl:value-of select="translate($locale, '_', '-')"/></xsl:attribute>
+        <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
     </xsl:attribute-set>
 
     <xsl:attribute-set name="__force__page__count">
diff --git a/demo/fo/xsl/fo/root-processing.xsl b/demo/fo/xsl/fo/root-processing.xsl
index 4c5751452..7fe3ccf6e 100644
--- a/demo/fo/xsl/fo/root-processing.xsl
+++ b/demo/fo/xsl/fo/root-processing.xsl
@@ -43,7 +43,8 @@ See the accompanying license.txt file for applicable licenses.
     <!--xsl:param name="bookmap-order" select="'discard'"/-->
   
     <xsl:variable name="retain-bookmap-order" select="*[contains(@class,' bookmap/bookmap ')]"/><!-- "and $bookmap-order eq 'retain'"-->
-    <xsl:variable name="writing-mode" select="'lr'"/>
+    <xsl:variable name="writing-mode">lr</xsl:variable>
+    <xsl:variable name="lang" select="substring($locale, 1, 2)"/>
       <!--xsl:variable name="lang" select="if (contains($locale, '_')) then substring-before($locale, '_') else $locale"/>
       <xsl:choose>
         <xsl:when test="some $l in ('ar', 'fa', 'he', 'ps', 'ur') satisfies $l eq $lang">rl</xsl:when>