You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Finn Bock <bc...@worldonline.dk> on 2004/09/30 12:25:07 UTC

Storing the Locator instance in FONode.

Hi Glen,

I think that your recent change that stores the Locator instance in each 
FONode is incorrect use of the Locator interface. The docs says:

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/org/xml/sax/Locator.html

"""
Note that the results returned by the object will be valid only during 
the scope of each content handler method: the application will receive 
unpredictable results if it attempts to use the locator at any other time.
"""

And in fact, it is the same Locator instance that is stored in each FONode.

I think it would be better to revert to using separate 
line/column/systemId fields if we want to know the location of each FONode.

regards,
finn

Re: Storing the Locator instance in FONode.

Posted by Finn Bock <bc...@worldonline.dk>.
[Glen]

> I see.  I liked Locator because I can get away with
> passing in one parameter into the vCN() instead of
> three.  (But I don't think we'll need to change that
> portion of the code because whenever vCN() is being
> called, the Locator *is* accurate--would you agree?)

Yes.

regards,
finn

Re: Storing the Locator instance in FONode.

Posted by Glen Mazza <gr...@yahoo.com>.
I see.  I liked Locator because I can get away with
passing in one parameter into the vCN() instead of
three.  (But I don't think we'll need to change that
portion of the code because whenever vCN() is being
called, the Locator *is* accurate--would you agree?)

Anyway, I do agree with your suggestion--obviously. 
If you would be able to take care of reverting it I
would appreciate it.  (If you find reverting it too
time-consuming, I can take care of it this weekend.) 
Also, thanks for the Locator lesson here.

Glen

--- Finn Bock <bc...@worldonline.dk> wrote:
> Hi Glen,
> 
> I think that your recent change that stores the
> Locator instance in each 
> FONode is incorrect use of the Locator interface.
> The docs says:
> 
>
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/org/xml/sax/Locator.html
> 
> """
> Note that the results returned by the object will be
> valid only during 
> the scope of each content handler method: the
> application will receive 
> unpredictable results if it attempts to use the
> locator at any other time.
> """
> 
> And in fact, it is the same Locator instance that is
> stored in each FONode.
> 
> I think it would be better to revert to using
> separate 
> line/column/systemId fields if we want to know the
> location of each FONode.
> 
> regards,
> finn
>