XSL Formatter V2 Q&A

XSLT/XSL-FO Conformance

XSLT

XSL-FO

Top
Basic, General
About XSL Formatter
Operation
Programming
XSLT/XSL-FO Conformance
XSLT/XSL-FO Technics
Index

XSLT

Q.  When formatting an existing XML file using XSLT stylesheet in the XSL Formatter, an error message appears to <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> written in XSL. Why? [No.2002011521]
A. 

XSL Formatter accepts only the XSLT stylesheet that is based on "XSL Transformation (XSLT)" Version1.0 W3C Recommendation. This error shows that the stylesheet you use is based on an old draft specification. Change your stylesheet based on XSLT Version1.0 W3C Recommendation. Another reason to be considered, as you use an existing XML file, your stylesheet may be written for HTML transformation. You also need to modify stylesheet for XSL-FO transformation.


Q.  Can I find text using regular expressions or some other form of programming? [No.2003040402]
A. 

It's impossible to compose character strings using the regular expression in the usual state.

However, it is possible to extend XSLT and this also depends on the XSLT processor. As XSL Formatter can select the XSLT processor, the problem probably will be solved.

One is to use JavaScript with the XSLT stylesheet. Using the regular expression with JavaScript, character string operation is available. As for instruction for use, please refer to the specification of XSLT processor which has been used.

There might be a case that the extended specification by XSLT processor is implemented with non-JavaScript. Please refer to the specification of XSLT processor which has been used.


Q.  When there is the following description in the XML file, is the CSS effective? <?xml-stylesheet href="xxx.css" type="text/css"?> [No.2003111701]
A. 

Since XSL Formatter is intended for XSL-FO, the CSS is not effective. When there is a CSS specified in the XML file and there is no stylesheet specified through GUI or Command line, an error will occur. When a stylesheet is specified and XML is transformed into XSL-FO, an error doesn't occur and the CSS will be ignored.


XSL-FO

Q.  Does XSL Formatter support glyph-orientation-vertical? [No.2002030102]
A. 

In current XSL Formatter, glyph-orientation-vertical is not supported as yet.


Q.  I get the error message Invalid property value:border-before-width="1". Why do I get this error message? [No.2002041205]
A. 

The error message appears when a unit of measure is not placed after the value 1.


Q.  I specified block space-before="2.0in" at the beginning of the page. However, a space is not created. Why? [No.2002102507]
A. 

For example, In the following FO, space-before="2.0in" doesn't become effective.

<fo:flow>
<fo:block space-before="2.0in">
    AAAAAAAA
</fo:block>
</fo:flow>

Space conditionality at the beginning or end of a reference-area or a line-area is one whose default value is "discard". Therefore, if you specify space-before="2.0in" to the start block of a reference-area, it's considered to be invalid.

The following example also shows the same behavior.

<fo:flow>
<fo:block>
<fo:block space-before="2.0in">
    AAAAAAAA
</fo:block>
</fo:block>
</fo:flow>

When there are no space or border/padding which are acceptable to be discarded in the parent block, the first child block becomes the target one and space-before="2.0in" specified to the child block becomes invalid because space-before.conditionality="discard".

Therefore, if you want to make space-before effective, you need to specify "retain" to space-before.conditionality.

<fo:flow>
<fo:block space-before="2.0in" space-before.conditionality="retain">
    AAAAAAAA
</fo:block>
</fo:flow>

Q.  XSL Formatter does not report as an error even if two or more fo:markers that share the same parent have the same "marker-class-name" property. I think this behavior viorates 6.11.3, Constraints: no duplicate marker class names w/in same parent. [No.2002111507]
A. 

It is not the duty to show the error message according to the specification of XSL-FO. It's simply because XSL Formatter omits the checking of this error.

Therefore, It's not clear whether this problem is improved by the version of the future.

<fo:block>
<fo:marker classname="my-marker"/>
<fo:marker classname="my-marker"/>

  rest of block content

</fo:block>

Q.  I specified "widows" and "orphans" property, but it is not effective. [No.2003050901]
A. 

See the specification of referred CSS2 from W3C Recommendation. More detail is here.

13.3.4 Allowed page breaks

In the normal flow, page breaks can occur at the following places:

1. In the vertical margin between block boxes. When a page break occurs
here, the computed values of the relevant 'margin-top' and 'margin-bottom'
properties are set to '0'.

2. Between line boxes inside a block box.

These breaks are subject to the following rules:

Rule A: Breaking at (1) is allowed only if the 'page-break-after' and 'pagebreak-
before' properties of all the elements generating boxes that meet at
this margin allow it, which is when at least one of them has the value
'always', 'left', or 'right', or when all of them are 'auto'.

Rule B: However, if all of them are 'auto' and the nearest common ancestor
of all the elements has a 'page-break-inside' value of 'avoid', then breaking
here is not allowed.

Rule C: Breaking at (2) is allowed only if the number of line boxes between
the break and the start of the enclosing block box is the value of 'orphans' or
more, and the number of line boxes between the break and the end of the
box is the value of 'widows' or more.

Rule D: In addition, breaking at (2) is allowed only if the 'page-break-inside'
property is 'auto'.

Rule C is a condition that orphans and widows are applied.

This is "2. Between line boxes inside a block box. ", orphans and widows is applied to line in one block.

Therefore, when two or more block is included in block area where the orphans and widows property was specified, it is likely to change page in the boundary of inside block.


Q.  Is it possible to start the page number from 0 by setting to <fo:page-number/>. [No.2003111704]
A. 

No, it's impossible to start the page-sequence from 0.

7.25.7. "initial-page-number"

Values have the following meanings:
<integer>

A positive integer. If a negative or non-integer value is provided, the
value will be rounded to the nearest integer value greater than or equal
to 1.

Therefore if the value 0 is specified, the initial value becomes the value 1.


Q.  When I specified width and padding-left for fo:inline, the width of the fo:inline was a value of width + padding-left. Why is the output result different from Internet Explorer 6? [No.2004040201]
A. 

The width property specifies the width of content-rectangle. border-width and padding-left/padding-right are not included.

Please refer to the following for the matter that IE is different from the CSS specification. CSS Enhancements in Internet Explorer 6


Q.  The text-indent is specified for fo:block that moved by side-float. However, it is not effective. Why? [No.2004040202]
A. 

This is correct work of intrusion-displace. When intrusion-displace is not specified (The default value is auto), it is defined in the XSL-FO specification as follows.

7.18.3. “intrusion-displace”
auto
For a reference-area, this value is treated as if "block" had been specified. For any other area, this
value is treated as if "line" had been specified.
....
block
The start edge (and end edge) of the block is displaced by the least amount necessary to insure
that (a) the start edge (end edge) of the block does not intersect any of the start intrusions (end
intrusions) that overlap that block and (b) the amount by which it is displaced is at least as much
as the displacement of the parent area, provided the parent is a block-area which is not a referencearea.
An intrusion is said to overlap a block if the there is a line parallel to the inline progression
direction that intersects the allocation rectangles of both the block and the intrusion.

Therefore, if it is not larger than the value moved by side-float, the indent value specified for fo:block is invalid.

If intrusion-displace="indent" is specified, indent value specified for fo:block is effective.

indent
The start edge (and end edge) of each line within the block area on which the property occurs is
displaced (a) by at least the same amount it would be displaced by the "line" value of this property
and (b) in addition, by an amount that preserves the relative offset of that start edge (or end edge)
with respect to the start edge (or end edge) of any other line displaced by any intrusion that cause
the current line to be displaced. If there is more than one intrusion that could cause a displacement
of the line, the largest such displacement is used.

Q.  I specified break-after="page" for fo:block of the child of fo:table-cell. However, the page doesn't break. Why? [No.2004042702]
A. 

Your FO is as follows:

<fo:table-row >
<fo:table-cell >
<fo:block break-after="page">Cell 1</fo:block>
</fo:table-cell>
</fo:table-row>

In "4.8 Keeps and Breaks" of the XSL-FO specification, the break-after condition is defined as follows.

A break-after condition depends on the next formatting object in the flow; 
the condition is satisfied if either there is no such next formatting object, or 
if the first normal area generated and returned by that formatting object is 
leading in a context-area.

The content of table-cell is thought to be independent flow respectively. Therefore, because the following FO doesn't exist, it matches to this break-after condition.

If this condition is not based, the page break is contradicted in following FO.

<fo:table-row >
<fo:table-cell >
<fo:block break-after="page">Cell 1</fo:block>
</fo:table-cell>
<fo:table-cell >
<fo:block >Cell 2</fo:block>
</fo:table-cell>
</fo:table-row>

Q.  I specified width="100%" for the nested table. However, the width of an inside table doesn't extend up to the width of the cell, and there is space in the right side. Why? [No.2004050602]
A. 

In your FO:

<fo:block margin-right="8.0px" margin-left="8.0px" ...>
  ...
  <fo:table margin-right="2.0px" margin-left="2.0px"
            border-left-width="2.0px" border-right-width="2.0px" ...
            width="100.0%">
    ...
      <fo:table-cell padding-left="1.0px" padding-right="1.0px" ...>
        <fo:block>
          ...
          <fo:table margin-right="0pt" margin-left="0pt"
                    border-left-width="2.0px" border-right-width="2.0px" ...
                    width="100.0%">
            ...
              <fo:table-cell padding-left="1.0px" padding-right="1.0px" ...>
                <fo:block>
                  <fo:table margin-right="0pt" margin-left="0pt"
                    border-left-width="2.0px" border-right-width="2.0px" ...
                    width="100.0%">
                    ...

It is important that the base value of the width of the area for which % was specified is width of content-rectangle of the parents area in the area. The first outside table width (width=100%) is width of content-rectangle of block where the table is included. margin-right="8.0px" and margin-left="8.0px" are specified for this block. Therefore, tables narrow more than the width of region-body by the value (16px).

The second table similarly has the width of content-rectangle of the parents' block. This block has the inherited indent value. This indent value is total value of margin-left/right (each 2px) and border-left/right (each 2px) specified for an outside table. Please refer to "5.3.2 Margin, Space, and and Indent Properties" of the XSL-FO specification. Therefore, it narrows more than the width of an outside cell by this value (total 8px).

The third table is also similar to the second table. However, because margin-left/right specified for the second table is 0pt, a value that is narrower than the width of an outside cell is border-left/right of the second table (total 4px).


Copyright © 1999-2004 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.