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 bu...@apache.org on 2003/08/27 17:30:59 UTC

DO NOT REPLY [Bug 22761] New: - Two XSLTInputHandler constructors do not work properly (TraxInputHandler bugs)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22761>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22761

Two XSLTInputHandler constructors do not work properly (TraxInputHandler bugs)

           Summary: Two XSLTInputHandler constructors do not work properly
                    (TraxInputHandler bugs)
           Product: Fop
           Version: 0.20.5
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: general
        AssignedTo: fop-dev@xml.apache.org
        ReportedBy: Rostislav.Titov@cern.ch
                CC: Rostislav.Titov@cern.ch


XSLTInputHandler has three constructors, but only one of them (XSLTInputHandler
(File, File)  works properly. A Driver which tries to render anything using an 
XSLTInputHandler created with the constructor that takes two InputStreams or the 
constructor that takes the URLs will crash.

This is because of two bugs in the TraxInputHandler: both getInputSource() and 
getParser() assume that the object was created by using the (File, File) constructor.

Here are my suggestions how to fix these bugs (TraxInputHandler.java) :

    public InputSource getInputSource()
    {
        return (this.xmlSource == null) ? InputHandler.fileInputSource(xmlfile) : xmlSource;
    }

    public XMLReader getParser()
        throws FOPException
    {
        // xsltSource member variable should be added and propertly initialised by the two 
constructors
        return getXMLFilter(xmlfile, (xsltSource == null) ? new StreamSource(xsltfile), 
xsltSource);
    }

    public static XMLFilter getXMLFilter(File xmlfile, StreamSource source)
        throws FOPException
    {
      ....
      XMLFilter xmlfilter = saxTFactory.newXMLFilter(source);
      ....
    }


Hope this report will be useful... 

cheers,
Slava

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org