You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by mi...@objectweb.org on 2004/05/28 19:15:36 UTC

resolver.jar does not handle Windows file names

I have been getting an error from transformation that is caused by an 
invalid file name being processed by document().

<xsl:variable name='doc' value='document("c:/..... ")/>

This statement works as desired if resolver.jar is NOT on the classpath. 
However, when resolver.jar is on the classpath, then I get an exception.

     [xslt] 
resolveURI(C:/java/j2eetck/src/com/sun/ts/tests/ejb/ee/deploy/entity/cmp11/single/ejb_depEcmp11_single_ejb.jar.sun-ejb-jar.xml)
     [xslt] 
C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/templates/sun2jonas.xslt:40:70: Fatal 
Error! java.lang.reflect.InvocationTargetException Cause: 
java.lang.reflect.InvocationTargetException
     [xslt] 
file:/C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/templates/jonas-ejb-jar.xslt:256:49: 
Fatal Error! Fatal error during transformation Cause: Fatal error during 
transformation
 
Changing the statement to the following corrects the problem.  The URI is 
resolved correctly.
<xsl:variable name='doc' value='document("/c:/..... ")/>

     [xslt] 
resolveURI(/C:/java/j2eetck/src/com/sun/ts/tests/ejb/ee/deploy/entity/cmp11/single/ejb_depEcmp11_single_ejb.jar.sun-ejb-jar.xml)
     [xslt] Resolved URI: 
/C:/java/j2eetck/src/com/sun/ts/tests/ejb/ee/deploy/entity/cmp11/single/ejb_depEcmp11_single_ejb.jar.sun-ejb-jar.xml


It seems this is a bug in resolver.jar.  Since the transform works 
correctly if resolver.jar is not on the classpath, then it seems that the 
sax parser does recognize windows style absolute path names.

FWIW, the java.lang.reflect.InvocationTargetException did not give a clue 
as to what the problem was.  I had to run ANT with -verbose to get a stack 
trace to discover a message some 80 lines into the trace:

Caused by: javax.xml.transform.TransformerException: Malformed URL 
C:/java/j2eetck/src/com/sun/ts/tests/ejb/ee/deploy/entity/cmp11/single/ejb_depEcmp11_single_ejb.jar.sun-ejb-jar.xml(base 
file://C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/)

It would have been nice if resolver (or is it the parser) included the 
"Malformed URL" information in the console output.

Michael Giroux

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: resolver.jar does not handle Windows file names

Posted by Joseph Kesselman <ke...@us.ibm.com>.



The resolver is expecting a URI, and a Windows file name is not a URI.

Use <xsl:variable name='doc' value='document("file:///c:/..... ")/>

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org