Skip to content

Commit 4267508

Browse files
committed
Eliminate PDF doc build margin problem [skip appveyor]
This is an AI analysis of errors reported by Apache fop. The error looks like this (same for margin-right - line-breaks mine): [ERROR] FOUserAgent - Invalid property value encountered in margin-left="": org.apache.fop.fo.expr.PropertyException: file:/home/mats/github/scons/build/doc/user/scons-user.fo:3:6: No conversion defined ; property:'margin-left' (See position 147:8) Some builds of fop report the error as SEVERE rather than ERROR. The problem was identified as: A. When `$fop.extensions != 0`, the `<xsl:value-of>` inside `<xsl:attribute>` elements produces whitespace-padded content that FOP can't parse as valid length values B. When `$fop.extensions = 0`, the `<xsl:attribute>` elements with empty content produce empty strings The solution is to use `<xsl:choose>` blocks that always produce valid length values: - When `$fop.extensions != 0`: use `0pt` (simple, valid FOP length) - When `$fop.extensions = 0`: use the original dynamic variable values To summarize the two-part fix across all four `scons_title.xsl` files: 1. (1 pair per file): Removed the redundant `xsl:attribute` elements from `scons-titlepage-first` that conflicted with the literal `margin-left="0mm" margin-right="0mm"` 2. (11 blocks per file, already applied): Replaced the broken content-mode `xsl:attribute` blocks that produced empty strings or malformed `concat()` values: Note: we only build doc/man and doc/user, but the same fixes were applied to the two unused documents for consistency. Signed-off-by: Mats Wichmann <mats@linux.com> Assisted-by: OpenCode 1.18.5 driving Qwen 3.8
1 parent 9efe5af commit 4267508

6 files changed

Lines changed: 311 additions & 282 deletions

File tree

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
149149
- Clarify internal usage of zipimporter (not user-visible code)
150150
- Fixed an old problem in PDF doc generation where the path to an
151151
image file ended up with a "not found" error.
152+
- Fixed a PDF doc build problem relating to illegal margin widths ("").
152153
- Reference manual improvements:
153154
* More clarifications in Builder Methods section.
154155
* Clarify VariantDir behavior when switching from duplicate=True (the

RELEASE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ DOCUMENTATION
187187
- Fixed an old problem in PDF doc generation where the path to an
188188
image file ended up with a "not found" error.
189189

190+
- Fixed a PDF doc build problem relating to illegal margin widths ("").
191+
190192
DEVELOPMENT
191193
-----------
192194

0 commit comments

Comments
 (0)