You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by First Name Last Name <la...@my-deja.com> on 2000/10/28 04:06:39 UTC

Xalan-J 1.2 XSLTInputSource Problem

I recently installed the xalan-j_1_2 download from xml.apache.org, and
am experiencing an interesting set of problems (Win9x, WinNT, Solaris).  

<background>
I have operational, servlet-based,  xml/xsl transformations based upon 
LotusXSL1_0_1.  In those servlets, I 1) instantiate my xslStylesheet object
(new XSLTInputSource()), 2) associate the XSL file
(xslStyleSheet.setSystemId(xslfile)), where xslfile is the system file
name of the XSL file, 3) instantiate my xmlSource object (new
XSLTInputSource(chararray)), where chararray is my XML content, 4) 
instantiate the processor object (new XSLProcessor()), 5) define my
htmlOutput (new XSLTResultTarget(out)), and 6) finally
invoke the translation process (processor.process(xmlSource,
xslStylesheet, htmlOutput).  Like I said, this works.
</background>

Now enter Xalan 1.2... I get generic "unable to process XSL..." or so
messages.  After picking apart my code and using debugging and modifying
the sample DefaultApplyXSL servlet, it seems I can no longer define my
XSLTInputSource with anything other than a URL refeference.  Although the 
org.xml.sax.InputSource doc says I have a plethora of choices for
instantiating / valueing the XSLTInputSource object
(byte streams, character streams, system id's, URL's), a 
fully qualified URL is the only way I've been able to make it work, and
then, only with limited success.

Even though I can successfully instantiate an XSLTInputSource object
(e.g., no Exception is thrown), I'll get a number of errors depending
upon how I valued the XSLTInputSource object.  If I pass a file name
reference, the error returned states the file could not be found.  If I
stream the file contents into the XSLTInputSource object, the error
returned generally states the file is invalid, or "The root element 
is required in a well-formed document..."  BTW, I can take the same
XML and XSL documents and run the command line feature and it works
fine.

Is a URL reference the only permissible way to access an XSLTInputSource
object?  Say it is, so now I found another problem.  Apparently the
source will not be found if the URL represents a protected resource.
For example, our servlets operate in our extranet; users must
authenticate before the web server serves the resource.  What I observe
leads me to believe that a separate (thread??) URL request is generated
to retrieve the XSLTInputSource object.  I noticed java.net at play.
What I'm guessing is that the resource would appear "not found" if the
web server expects the incoming request to reauthenticate.  The only
reason the web server would want reauthentication is if an HTTP
request header was created that is different from the original, requesting,
HTTP header.  What would then seem to occur is that Xalan
or Xerces is not using the original HTTP header (which contains
current, authenticated session information).

In any event, I can't get this to work.  I would certainly appreciate
any insight into this situation.  Thanks in advance.

      Larry


------------------------------------------------------------
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.