[ http://nagoya.apache.org/jira/browse/XALANJ-853?page=history ]
     
Henry Zongaro resolved XALANJ-853:
----------------------------------

    Resolution: Duplicate

This is a duplicate of XALANJ-169.

> No Locator available to ContentHandler (SAXResult)
> --------------------------------------------------
>
>          Key: XALANJ-853
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-853
>      Project: XalanJ2
>         Type: Bug
>   Components: SAX
>     Versions: 2.3
>  Environment: Operating System: All
> Platform: PC
>     Reporter: Omri Traub

>
> I am sending the output from Xalan to a ContentHandler, registered as a 
> SAXResult with the processor.
> In processing the sax events, I'd like to know the line number in the XSL 
> file 
> where the processor is.
> The comment on ContentHandler.setDocumentLocator() says:
> ****
> SAX parsers are strongly encouraged (though not absolutely required) to 
> supply 
> a locator: if it does so, it must supply the locator to the application by 
> invoking this method before invoking any of the other methods in the 
> ContentHandler interface.
> The locator allows the application to determine the end position of any 
> document-related event, even if the parser is not reporting an error. 
> Typically, the application will use this information for reporting its own 
> errors (such as character content that does not match an application's 
> business rules). The information returned by the locator is probably not 
> sufficient for use with a search engine.
> ***
> This looks very useful, but unfortunately, Xalan falls into the category of 
> parsers (SAX event sources) that don't support this.
> So I tried to get arround this, by calling on 
> TransformerImpl.getCurrentElement
> (), which gives me line numbers.  But because of the buffering done by the 
> ResultTreeHandler, by the time startElement() is called from flushElem(), the 
> context in the transformer object is wrong.
> Is there any way around this?  The best may be update the caching in 
> ResultTreeHandler (like m_name, m_localName, m_url, and m_attributes) to 
> somehow keep a Locator object up to date with the pending element and pass 
> that object to setDocumentLocator() before processing.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to