Andreas L Delmelle wrote:
> On Dec 14, 2007, at 11:55, Vincent Hennebert wrote:
> 
>> Hi Andreas,
>>
>>> +        while (!(ancestor instanceof Flow)
>>> +                && ancestor instanceof Wrapper) {
>>
>> Might be wrong, but isn’t that the very same as:
>>     while (!(ancestor instanceof Wrapper))
>> ?

rhaaaa! (Hitting my head against the table several times.)

Sorry, I meant:
    while (ancestor instanceof Wrapper)
The original loop will stop when:
    ancestor instanceof Flow || !(ancestor instanceof Wrapper)
which is equivalent to simply
    !(ancestor instanceof Wrapper)
So I think the loop may be simplified.


<snip/>

>> And regarding the validation, wouldn’t it be safer to call the
>> validateChildNode of the nearest non-wrapper ancestor? That way this
>> class would really keep neutral, and we wouldn’t have to worry about the
>> implementation of new FO elements.
> 
> There's an idea, although, strictly speaking the fo:wrapper has its own
> content-model.

Sure. Wrapper could check for the exceptions it introduces (mainly the 
acceptance of fo:markers as its initial children), and defer to its 
parent element for the rest. Then that wouldn’t even be needed to 
recursively get the nearest non-wrapper ancestor IIC.

> But you are right, in that it only disallows parts of that
> content-model, if its parent would not allow them as children...
> 
> Going to try this approach, and will get back to you on that.
> 
> 
> Thanks for the feedback.
> 
> Cheers
> 
> Andreas

Vincent

-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

Reply via email to