You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Bojan Cekrlic <ce...@parsek.net> on 2001/02/12 19:20:45 UTC
RE: SAX Exception using the Xalan processor when disabling cookie
s on the browser
AFAIK session has no relevance here. Try setting session="false" in your
JSP file, maybe it will help, I don't know.
Anyone else?
Bojan
-----Original Message-----
From: Nicole Henrich [mailto:nicole.henrich@voxmobili.com]
Sent: Monday, February 12, 2001 4:39 PM
To: xalan-dev@xml.apache.org
Subject: SAX Exception using the Xalan processor when disabling cookies
on the browser
I'm using the Xalan XSLTProcessor to generate html from a XML and a XSL
file.
Here is the source code:
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
StringReader xmlSource =
compositeManager.outputXml().toStringReader();
String xslFile = "file:C:/xsl/toto.xsl";
StringWriter htmlSource = new StringWriter();
XSLTInputSource inputXml = new XSLTInputSource(xmlSource);
XSLTInputSource inputXsl = new XSLTInputSource(xslFile);
XSLTResultTarget resultTarget = new XSLTResultTarget(htmlSource);
processor.process(inputXml, inputXsl, resultTarget);
where compositeManager.outputXml().toStringReader() creates a
StringReader
containing the XML code.
This code works well if I allow cookies in my browser. Else it generates
the following SAX Exception :
The entity name must immediately follow the '&' in the entity
reference.
But if the XML file physically exists on the server and the associated
XSLTInputSource is created
with the location of this file, it works even without cookies:
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
String xmlFile = "file:C:/xml/toto.xml";
String xslFile = "file:C:/xsl/toto.xsl";
StringWriter htmlSource = new StringWriter();
XSLTInputSource inputXml = new XSLTInputSource(xmlFile);
XSLTInputSource inputXsl = new XSLTInputSource(xslFile);
XSLTResultTarget resultTarget = new XSLTResultTarget(htmlSource);
processor.process(inputXml, inputXsl, resultTarget);
The problem is, I have to generate one XML for each page and for each
client, because it contains
dynamical data specific to each client, and I would like to make it
working even without cookies.
But it seems the processor uses the session information to associate
each xml with its client.
It there a solution to this problem ? Thank you very much for your help.