Simon Pepping wrote:

> Indeed. Something like ICLM is needed, which creates an inline area
> containing the block areas.

A block inside another block

<fo:block>Normal text <fo:block>inner block</fo:block> normal text.</fo:block>

creates 3 different paragraphs:
- Normal text
- inner block
- normal text.
and each paragraph's layout is unrelated to the other paragraphs' layout (there 
are 3 LineLM).

A block inside an inline inside a block

<fo:block>Normal text <fo:inline background-color="lightgreen">inline text 1
<fo:block>inner block</fo:block> inline text 2</fo:inline> normal

a) 3 different paragraphs too:
- Normal text inline text 1
- inner block
- inline text 2 normal text.
b) a single paragraph with all the text:
- Normal text inline text 1 inner block inline text 2 normal text.

I'd say a), but I'm not sure.
If this were true, there should be 3 different LineLMs.

This is the LM tree at the moment:

       |            |            |
    TextLM      InlineLM      TextLM
"Normal text"       |      "normal text."
       |            |            |
    TextLM       BlockLM2     TextLM
"inline text 1"     |     "inline text 2"
              "inner block"

LineLM1 tries to have get elements from all its chidren, and fails.

But, even if it could be given the elements representing "inner block", it
could layout them wrongly, because of the block properties: the inner
block could have different alignment, borders, margins, indents, ....

So, the LM tree could be:

              |                 |                |
           LineLM           BlockLM2          LineLM
       ------+------            |           -----+-----
       |           |            |           |         |
    TextLM     InlineLM      LineLM     InlineLM    TextLM
"Normal text"      |            |           |    "normal text."
                   |            |           |
                TextLM       TextLM      TextLM
       "inline text 1"   "inner block"   "inline text 2"

This modified tree can be "easily" obtained from the previous one:
- the new BlockLM is created
- if the LM which should add it to its children list is an InlineLevelLM
or a LineLM, the new BlockLM is given to its parent, i.e. it will become a
child of the nearest BlockLM ancestor
- an instance of the LM which could not handle the new BlockLM (in the
example, InlineLM son of LineLM) must be created in order to handle inline
siblings of the inner fo:block.

I hope this can help ...


Reply via email to