Hello,

I've built a little Java application that let's the user browse to an XML file, select it, then the XML file is transformed via a static XSL file. Everything has been working fine, until I needed to use XSLT 2.0. So I had to switch to Saxon 9, instead of the *standard* TransformerFactory XSLT processor. (Assuming my classpath is all good) It seems like Saxon does not care for my file naming syntax. Here's the portion that has the trouble:

--snip --
  if(result == JFileChooser.APPROVE_OPTION) {

    textXRTrip0.setText(jfilechooser.getSelectedFile().getPath());
    String xml_Input_File = (jfilechooser.getSelectedFile().getPath());
    textXRTrip1.setText(jfilechooser.getSelectedFile().getPath()+".xf");

      File InputFile = new File(xml_Input_File);
      File xfXSLTfile = new File("xml2xf.xsl");
      // just added this extra step 'x_i' to try to correct the
      // 'java.net.URISyntaxException:' - it seemed to do no harm, nor help
      File x_i = new File(InputFile.toURI());
      Source xmlIn = new StreamSource(x_i);
      Source xfRoundTripXSL = new StreamSource(xfXSLTfile);

      System.setProperty("javax.xml.transform.TransformerFactory",
       "net.sf.saxon.TransformerFactoryImpl");

      TransformerFactory transFact =
      TransformerFactory.newInstance()

      try { 
            Transformer trans = transFact.newTransformer(xfRoundTripXSL);
            trans.transform(xmlIn, new StreamResult(x_i + ".xf"));
          }
   catch(Exception ioe) { 
    System.err.println("Could not transform; malformed? ..." + x_i);
          }

      }
  }
--/snip --

I ran it in verbose mode, and got some telling errors (I'm just not experienced enough to know exactly what they are telling me). It clearly finds the files (making reference to actual elements in the source, "processing /rooty/p[1]" and actual code in the XSLT, "  at xsl:apply-templates (file:/C:/presentations/D-Europe-2009/presentation-and-demo/newD-XF-rt/xml2xf.xsl#11)"):

--snip --
Error at xsl:copy on line 10 of xml2xf.xsl:
  java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\D
ocuments and
  Settings\JG\Desktop\try\my.xml.xf

[Loaded net.sf.saxon.trace.ContextStackIterator from file:/C:/presentations/D
-Europe-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]
[Loaded net.sf.saxon.trace.ContextStackFrame from file:/C:/presentations/D-Eu
rope-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]
[Loaded net.sf.saxon.trace.ContextStackFrame$ApplyTemplates from file:/C:/presen
tations/D-Europe-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]

  at xsl:apply-templates (file:/C:/presentations/D-Europe-2009/presentation-a
nd-demo/newD-XF-rt/xml2xf.xsl#11)

[Loaded net.sf.saxon.tinytree.PrecedingSiblingEnumeration from file:/C:/presenta
tions/D-Europe-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]

     processing /rooty/p[1]

[Loaded net.sf.saxon.trace.ContextStackFrame$BuiltInTemplateRule from file:/C:/p
resentations/D-Europe-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]

  in built-in template rule

[Loaded net.sf.saxon.trace.ContextStackFrame$CallingApplication from file:/C:/pr
esentations/D-Europe-2009/presentation-and-demo/newD-XF-rt/saxon9.jar]

Could not transform; malformed? ...C:\Documents and Settings\JG\Desktop\try\
my.xml
--/snip --

I'll skip the plea of "couldn't find it in the FAQ" and "forgive me for being a newby," and just ask if anyone can tell what causes this misfire.

Thanks,

-jg-