Hi Todd,
        String stylesheet is of the form "d:\blah\blah\....\blah.xsl"


thanks,

Paul.

-----Original Message-----
From: G. Todd Miller - XML Tech Ctr - Development
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 19, 2001 2:49 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Problems with TransformerFactory.newTransformer()


Hi Paul,

What does 'String stylesheet' look like??? In the current code,
newTransformer takes a Source stylesheet and does two things (currently):
(1) casts the Source to a StreamSource and then attempts to get an
java.io.InputStream out of it, (2) tries to get a SystemId from Source
and it then tries to open a java.io.File from it.  My guess is that
if you are passing in a URL, then I need to handle that directly.


-Todd


>>System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xa
la
        >>n.xsltc.runtime.TransformerFactoryImpl");
        >>TemplateLoader theLoader = new TemplateLoader();
        >>String stylesheet =
        >>theLoader.getFileLocation(baseRoot,thePOS,theLocale,templateName);

What does String stylesheet look like???

        >>templatefilepath = theLoader.getTemplateFilePath();
        >>Templates template = null;
        >>String output = new String();
        >>        try
        >>        {
        >>            String xslInURI = stylesheet;
        >>            String xmlInURI = templatefilepath;
        >>            TransformerFactory tFactory =
TransformerFactory.newInstance();
        >>            Transformer transformer = tFactory.newTransformer(new
        >>StreamSource(xslInURI));  //THROWS EXCEPTION HERE
        >>            transformer.transform(new StreamSource(xmlInURI),new
        >>StreamResult(output));

=======================================================================
G. Todd Miller                        Sun Microsystems Computer Company
Software Systems Engineer             2 Network Drive, MS UBUR02-201
GE&IS XML Tech Center                 Burlington, MA 01803-0903
                                      781 442-0176
                                      781 442-1437 (fax)
                                      [EMAIL PROTECTED]


Reply via email to