Hi,

 

In order to support JDK 8 it was necessary to update to SaxonHE 9.  (can't
remember exactly why right now)

 

New problem is that when the Cocoon app is installed on a path with spaces
(say 'a-test 2') there's a new exception:

 

net.sf.saxon.trans.XPathException: Invalid URI for stylesheet:
file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl

                at
net.sf.saxon.event.ReceivingContentHandler.startDocument(ReceivingContentHan
dler.java:231)

                at
org.apache.xerces.parsers.AbstractSAXParser.startDocument(Unknown Source)

                at
org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)

                at
org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)

                at
org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown
Source)

                at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

                at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)

                at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

                at
org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)

                at
org.apache.excalibur.xmlizer.DefaultXMLizer.toSAX(DefaultXMLizer.java:128)

                at
org.apache.cocoon.components.xslt.TraxProcessor.sourceToSAX(TraxProcessor.ja
va:303)

                at
org.apache.cocoon.components.xslt.TraxProcessor.getTransformerHandlerAndVali
dity(TraxProcessor.java:241)

 

>From the Saxon website it seems the URI checking is more robust in the new
versions.

 

Tried changing the TraxProcessor.sourceToSax:

 

            final InputStream inputStream = source.getInputStream();

            final String mimeType = source.getMimeType();

            final String systemId = source.getURI();

            m_xmlizer.toSAX(inputStream, mimeType, systemId, handler);

 

to:

 

            final InputStream inputStream = source.getInputStream();

            final String mimeType = source.getMimeType();

            final String systemId = URLEncoder.encode(source.getURI(),
"UTF-8");

            m_xmlizer.toSAX(inputStream, mimeType, systemId, handler);

 

but get errors deeper then I'd like to go.  I'd appreciate any advice.

 

Thanks,

Gary

 

Reply via email to