RE: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Gary Larsen
It works if I install the app on a folder path without spaces.  If that’s
the limitation I can live with that, but would like to figure out a
solution.

 

Gary Larsen

Envisn Inc.

508 259-6465

 

From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 7:26 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 06/05/2016 13:17, Gary Larsen wrote:

Thanks.  Was trying to avoid adding a jar.

 

I’m guessing it would look something like this:

 

URI(source.getURI()).toASCIIString()


new URI(
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl")

throws URISyntaxException

Isn't it possible to just rename the "a-test 2" folder as "a-test2"? ;-)

Regards.




From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 7:02 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 06/05/2016 12:51, Gary Larsen wrote:

Hi,

 

Thanks for the response. I get the space to %20, but have not figured out
where to change the code in Cocoon.

 

Using this from the stack trace

 

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

 

I modified line 303 from:

 

final String systemId = source.getURI();

to:

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

 

This resulted in an exception in Excalibur.  Shouldn’t the encode() replace
the space with %20?


Sure, but not only.

For example,

URLEncoder.encode(
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl", "UTF-8")

produces

file%3A%2FC%3A%2Fa-test+2%2Fnetvisn-server-c1022-72-6043%2Fwebapps%2Fnetvisn
%2Fsite%2Fstylesheets%2Fnetvisn-error2html.xsl

..which I would hardly qualify as a valid URI :-)

Regards.





From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 2:51 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 05/05/2016 18:49, Gary Larsen wrote:

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


 
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl"

is not a valid URI, while

 

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/style
sheets/netvisn-error2html.xsl"

is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, you need
to percent-encode.

This as [1] says, "The space character, for example, is quoted by replacing
it with "%20"

HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html



-- 
Francesco Chicchiriccò
 
Tirasa - Open Source Excellence
http://www.tirasa.net/
 
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer 
http://home.apache.org/~ilgrosso/


Re: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Francesco Chicchiriccò

On 06/05/2016 13:17, Gary Larsen wrote:


Thanks.  Was trying to avoid adding a jar.

I’m guessing it would look something like this:

URI(source.getURI()).toASCIIString()


new URI("file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl")


throws URISyntaxException

Isn't it possible to just rename the "a-test 2" folder as "a-test2"? ;-)

Regards.


*From:*Francesco Chicchiriccò [mailto:ilgro...@apache.org]
*Sent:* Friday, May 06, 2016 7:02 AM
*To:* users@cocoon.apache.org
*Subject:* Re: Cocoon 2.1.9 and Saxon 9.6

On 06/05/2016 12:51, Gary Larsen wrote:

Hi,

Thanks for the response. I get the space to %20, but have not
figured out where to change the code in Cocoon.

Using this from the stack trace

at

org.apache.cocoon.components.xslt.TraxProcessor.sourceToSAX(TraxProcessor.java:303)

I modified line 303 from:

final String systemId = source.getURI();

to:

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

This resulted in an exception in Excalibur.  Shouldn’t the
encode() replace the space with %20?


Sure, but not only.

For example,

URLEncoder.encode("file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl" 
, 
"UTF-8")


produces

file%3A%2FC%3A%2Fa-test+2%2Fnetvisn-server-c1022-72-6043%2Fwebapps%2Fnetvisn%2Fsite%2Fstylesheets%2Fnetvisn-error2html.xsl

..which I would hardly qualify as a valid URI :-)

Regards.


*From:*Francesco Chicchiriccò [mailto:ilgro...@apache.org]
*Sent:* Friday, May 06, 2016 2:51 AM
*To:* users@cocoon.apache.org <mailto:users@cocoon.apache.org>
*Subject:* Re: Cocoon 2.1.9 and Saxon 9.6

On 05/05/2016 18:49, Gary Larsen wrote:

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-error2html.xsl


"file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl" 



is not a valid URI, while

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl" 



is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, 
you need to percent-encode.


This as [1] says, "The space character, for example, is quoted by 
replacing it with "%20"


HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html


--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer
http://home.apache.org/~ilgrosso/



RE: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Gary Larsen
Thanks.  Was trying to avoid adding a jar.

 

I’m guessing it would look something like this:

 

URI(source.getURI()).toASCIIString()

 

 

Gary Larsen

Envisn Inc.

508 259-6465

 

From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 7:02 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 06/05/2016 12:51, Gary Larsen wrote:

Hi,

 

Thanks for the response. I get the space to %20, but have not figured out
where to change the code in Cocoon.

 

Using this from the stack trace

 

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

 

I modified line 303 from:

 

final String systemId = source.getURI();

to:

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

 

This resulted in an exception in Excalibur.  Shouldn’t the encode() replace
the space with %20?


Sure, but not only.

For example,

URLEncoder.encode(
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl", "UTF-8")

produces

file%3A%2FC%3A%2Fa-test+2%2Fnetvisn-server-c1022-72-6043%2Fwebapps%2Fnetvisn
%2Fsite%2Fstylesheets%2Fnetvisn-error2html.xsl

..which I would hardly qualify as a valid URI :-)

Regards.




From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 2:51 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 05/05/2016 18:49, Gary Larsen wrote:

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


 
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl"

is not a valid URI, while

 

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/style
sheets/netvisn-error2html.xsl"

is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, you need
to percent-encode.

This as [1] says, "The space character, for example, is quoted by replacing
it with "%20"

HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html



-- 
Francesco Chicchiriccò
 
Tirasa - Open Source Excellence
http://www.tirasa.net/
 
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer 
http://home.apache.org/~ilgrosso/


Re: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Francesco Chicchiriccò

On 06/05/2016 12:51, Gary Larsen wrote:


Hi,

Thanks for the response. I get the space to %20, but have not figured 
out where to change the code in Cocoon.


Using this from the stack trace

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


I modified line 303 from:

final String systemId = source.getURI();

to:

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


This resulted in an exception in Excalibur.  Shouldn’t the encode() 
replace the space with %20?




Sure, but not only.

For example,

URLEncoder.encode("file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl", 
"UTF-8")


produces

file%3A%2FC%3A%2Fa-test+2%2Fnetvisn-server-c1022-72-6043%2Fwebapps%2Fnetvisn%2Fsite%2Fstylesheets%2Fnetvisn-error2html.xsl

..which I would hardly qualify as a valid URI :-)

Regards.


*From:*Francesco Chicchiriccò [mailto:ilgro...@apache.org]
*Sent:* Friday, May 06, 2016 2:51 AM
*To:* users@cocoon.apache.org
*Subject:* Re: Cocoon 2.1.9 and Saxon 9.6

On 05/05/2016 18:49, Gary Larsen wrote:

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-error2html.xsl


"file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl" 



is not a valid URI, while

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl" 



is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, 
you need to percent-encode.


This as [1] says, "The space character, for example, is quoted by 
replacing it with "%20"


HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html


--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer
http://home.apache.org/~ilgrosso/



RE: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Gary Larsen
Hi,

 

Thanks for the response. I get the space to %20, but have not figured out
where to change the code in Cocoon.

 

Using this from the stack trace

 

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

 

I modified line 303 from:

 

final String systemId = source.getURI();

to:

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

 

This resulted in an exception in Excalibur.  Shouldn’t the encode() replace
the space with %20?

 

 

Thanks,

Gary 

 

From: Francesco Chicchiriccò [mailto:ilgro...@apache.org] 
Sent: Friday, May 06, 2016 2:51 AM
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.9 and Saxon 9.6

 

On 05/05/2016 18:49, Gary Larsen wrote:

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


 
 "file:/C:/a-test
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-erro
r2html.xsl"

is not a valid URI, while

 

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/style
sheets/netvisn-error2html.xsl"

is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, you need
to percent-encode.

This as [1] says, "The space character, for example, is quoted by replacing
it with "%20"

HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html



-- 
Francesco Chicchiriccò
 
Tirasa - Open Source Excellence
http://www.tirasa.net/
 
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer 
http://home.apache.org/~ilgrosso/


Re: Cocoon 2.1.9 and Saxon 9.6

2016-05-06 Thread Francesco Chicchiriccò

On 05/05/2016 18:49, Gary Larsen wrote:


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-error2html.xsl




"file:/C:/a-test 
2/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl"


is not a valid URI, while

"file:/C:/a-test%202/netvisn-server-c1022-72-6043/webapps/netvisn/site/stylesheets/netvisn-error2html.xsl"

is valid instead.

The blank space between 'a-test' and '2' is not allowed within URI, you 
need to percent-encode.


This as [1] says, "The space character, for example, is quoted by 
replacing it with "%20"


HTH
Regards.

[1] http://docs.oracle.com/javase/8/docs/api/java/net/URI.html

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC,
Olingo PMC, CXF Committer, OpenJPA Committer
http://home.apache.org/~ilgrosso/



Cocoon 2.1.9 and Saxon 9.6

2016-05-05 Thread Gary Larsen
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