Re: Whitespace questions
Rebecca Lundberg wrote: > Is there any way to double space after a <fo:block>? > I tried using <xsl:text>
</xsl:text> (which works for .txt output) > and it didn't work. It should not. This only produces two linefeeds in the resulting FO file that are happily collapsed into a single space during formatting. > I tried using the space-after attribute <fo:block space-after = "24pt"> > and it didn't work. In this case, it should. Probably your formatter does not support shorthand notations. Try appending a component qualification to the attribute: <fo:block space-after.optimum="24pt"> However, to give further advices, it would be nice to learn the name/version of your XSL FO formatter. > This leads to how to preserve whitespace... <xsl:preserve-space elements="*"/> > didn't work. Same story: all <xsl:*> elements control spaces in the resulting XSL FO file only; these hints don't even arrive to the formatter. White space handling in XSL FO is controlled by a substantial set of specialized properties: "space-treatment", "linefeed-treatment", "white-space-collapse", "wrap-option", and "white-space" (the last is a CSS2 compatibility shorthand). > Within a list-item-body, I am printing a variable which might not always have > a value. When it has no value, the following list-item-label and > list-item-body overwrite the line where the list-item-body is empty -- even > if there is a label printed there. This is an evident bug. I think you should better submit a respective report to the authors of your tool, and ask for a fix. As an immediate temporary solution, try putting some dummy text white-on-white ;-), like in the code below: <fo:list-item-body start-indent="4in"> <xsl:choose> <xsl:when test="normalize-space($wholeName)=''"> <fo:block color="white">*</fo:block> <!-- placeholder --> </xsl:when> <xsl:otherwise> <fo:block><xsl:value-of select="$wholeName"/></fo:block> </xsl:otherwise> </xsl:choose> </fo:list-item-body> By the way: in your example, list-item-label and list-item-body have equal start-indents. According to the spec, this is an error: the label and the body of your list should overlap. If they don't, list implementation in your formatter is not conformant to W3C specs. Hope this helps. Best regards, Nikolai Grigoriev RenderX XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format