[ http://nagoya.apache.org/jira/browse/XALANJ-1286?page=history ]

Henry Zongaro updated XALANJ-1286:
----------------------------------

    Priority: Major  (was: Blocker)

> Transformer fails when Templates constructed with "new StreamSource(new 
> FileReader(<filepath>))"
> ------------------------------------------------------------------------------------------------
>
>          Key: XALANJ-1286
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1286
>      Project: XalanJ2
>         Type: Bug
>   Components: XPath-function
>     Versions: 2.4
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Walter Sujansky

>
> Note the difference in the way that the Templates instance is created in the 
> following code snippet ("xslFile" is a String containing a file path):
>     TransformerFactory tf = TransformerFactory.newInstance();
>     //THIS ONE WORKS
>     Templates t = tf.newTemplates(new StreamSource(xslFile));
>     //THIS ONE THROWS AN ERROR:  "Unknown error in XPath"
>     //Templates t = tf.newTemplates(new StreamSource(new 
> FileReader(xslFile)));
>     Transformer transformer = t.newTransformer();
>     //Starts a server object whose methods are called from the xsl stylesheet
>     LocalTermServer tm = initLocalTermServer();
>     transformer.setParameter("te",tm);
>     transformer.transform(new StreamSource(inputFile), new 
> StreamResult(outputFile));
> When the bad version is used, the Unknown XPath error is thrown at the time 
> transform() is called (all preceding statements succeed without apparent 
> error, and this code compiles without error).
> This problem occurs only when a stylesheet is used that contains extension 
> functions and the "document()" function (simpler stylesheets work without 
> problem).  Is this a known bug?  Note that similar problems occur when an 
> InputStream instance is used to construct the StreamSource also (i.e. ->
>     //Templates t = tf.newTemplates(new StreamSource(anInputStream));
> Obviously, TransformerFactory.getTemplates() should work the same regardless 
> of 
> how the StreamSource that is its argument was created.  That doesn't seem to 
> be 
> the case, at least with certain kinds of stylesheets.

-- 
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