RE: Switching to Saxon
On 22/12/10 10:16, Johan Cwiklinski wrote: [...] > I always use the doc-available($uri) function so I can print $uri using > xsl:message if there is an error: Unfortunately I'm still using XSLT 1.0 in this application because the scripts also need to run elsewhere in an environment where XSLT2 is not available. But that will change soon :-) >> b. Any ambiguity in template selection (normally a recoverable warning >> if you run Saxon from the command line) returns the "Ambiguous..." >> message as an error. Is this configurable? (ie get Saxon to not pass an >> error status to Cocoon, but just log a warning, and continue recoverably >> as it does in commandline mode?). > > I do not know. > When I've got ambiguity in template selection, I usually solve that in > the XSL file ;) Yep. Fixed now...thanks for all the help. ///Peter <> - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Switching to Saxon
Hi, Le 22/12/2010 11:05, Peter Flynn a écrit : > On 17/12/10 08:43, Johan Cwiklinski wrote: >> Hello, > [...] >> Here is our configuration: > [...] >> Hope that could help you :) > > Thanks very much, that did it. It was unclear from the docs where you Cool :) > put the name of the .jar file ("saxon9") and where you just put the name > "saxon". > > One thing that switching to Saxon has done is reveal the holes in my > XSLT :-) > > a. If a URI call to Cocoon to retrieve a web page through a Tidy > pipeline (to make it XML) returns an empty file (really null, not even > an empty root element), Xalan treats the statement > I always use the doc-available($uri) function so I can print $uri using xsl:message if there is an error: Unable to load: > as a non-event, and $foo is unset (that is, a binary test for if="$foo" > returns false). Saxon, on the other hand, emits a Java error message > about a null pointer; technically correct, except that it makes it > untestable because the error occurs before the document() call > completes, so its status is inaccessible in the XSLT. > > b. Any ambiguity in template selection (normally a recoverable warning > if you run Saxon from the command line) returns the "Ambiguous..." > message as an error. Is this configurable? (ie get Saxon to not pass an > error status to Cocoon, but just log a warning, and continue recoverably > as it does in commandline mode?). I do not know. When I've got ambiguity in template selection, I usually solve that in the XSL file ;) > > Obviously writing better XSLT is the answer...I should have paid closer > attention to Mike and Jeni's sessions on testing at the XML Summerschool... > > ///Peter Regards, -- Johan Cwiklinski AJLSM - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Switching to Saxon
On 17/12/10 08:43, Johan Cwiklinski wrote: > Hello, [...] > Here is our configuration: [...] > Hope that could help you :) Thanks very much, that did it. It was unclear from the docs where you put the name of the .jar file ("saxon9") and where you just put the name "saxon". One thing that switching to Saxon has done is reveal the holes in my XSLT :-) a. If a URI call to Cocoon to retrieve a web page through a Tidy pipeline (to make it XML) returns an empty file (really null, not even an empty root element), Xalan treats the statement as a non-event, and $foo is unset (that is, a binary test for if="$foo" returns false). Saxon, on the other hand, emits a Java error message about a null pointer; technically correct, except that it makes it untestable because the error occurs before the document() call completes, so its status is inaccessible in the XSLT. b. Any ambiguity in template selection (normally a recoverable warning if you run Saxon from the command line) returns the "Ambiguous..." message as an error. Is this configurable? (ie get Saxon to not pass an error status to Cocoon, but just log a warning, and continue recoverably as it does in commandline mode?). Obviously writing better XSLT is the answer...I should have paid closer attention to Mike and Jeni's sessions on testing at the XML Summerschool... ///Peter - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: Switching to Saxon
Sorry, I meant Tomcat. As we only have one Cocoon based webapp, the concepts of tomcat and cocoon have kind of merged in my mind. > -Original Message- > From: Peter Flynn [mailto:pfl...@ucc.ie] > Sent: Friday, December 17, 2010 9:08 AM > To: users@cocoon.apache.org > Subject: Re: Switching to Saxon > > On 16/12/10 16:23, Schmitz, Jeffrey A wrote: > > Taking a quick look, that looks like the same as I did, although I'm > > using a saxon9he.jar file. To ask maybe a dumb question, did you > > restart Cocoon after adding the jar? > > No, I assumed any change would force Tomcat to reread it all. > I can restart Tomcat but I'm not aware of how to restart Cocoon itself. > > ///Peter > > > > >> -Original Message- > >> From: Peter Flynn [mailto:pfl...@ucc.ie] > >> Sent: Thursday, December 16, 2010 9:58 AM > >> To: users@cocoon.apache.org > >> Subject: Switching to Saxon > >> > >> I just tried this, but there seems to be a lack of up-to-date > details > >> on > >> doing this in Cocoon 2.1.11 with saxon9. Following the assorted web > >> pages for earlier versions, I got as far as adding saxon9.jar to > >> Cocoon's WEB-INF/lib and editing the two files (commenting out the > >> Xalan > >> entries): > >> > >> - cocoon.xconf: > >> > >>>> > role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" > >> > class="org.apache.cocoon.components.xslt.TraxProcessor"> > >> > >> >> value="net.sf.saxon.TransformerFactoryImpl"/> > >> > >> > >> - sitemap.xmap: > >> > >>>> pool-min="8" logger="sitemap.transformer.xslt" > >> src="org.apache.cocoon.transformation.TraxTransformer"> > >> false > >> false > >> false > >> false > >> saxon > >> true > >> > >> > >> But then Cocoon spits out: > >> > >>> Internal Server Error > >>> Message: Could not find component (key > >> [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) > >>> Description: org.apache.cocoon.ProcessingException: Lookup of > >> transformer 'xslt' failed at - > >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 > >>> Sender: org.apache.cocoon.servlet.CocoonServlet > >>> Source: Cocoon Servlet > >>> > >>> cause > >>> org.apache.avalon.framework.component.ComponentException: Could not > >> find component (key > >> [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) > >>> full exception chain stacktrace > >>> org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt' > >> failed > >>> at - > >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 > >>> at > >> > org.apache.cocoon.ProcessingException.throwLocated(ProcessingException. > >> java:113) > >> > >> What is it actually looking for when it says > >> org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea > what > >> or where "org.apache.excalibur.xml.xslt.XSLTProcessor" points to > (I'm > >> sure it's possible to find out, but I'm not a Java programmer :-) > >> > >> ///Peter > >> > >> > - > >> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > >> For additional commands, e-mail: users-h...@cocoon.apache.org > > > > > - > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Switching to Saxon
On 16/12/10 16:23, Schmitz, Jeffrey A wrote: > Taking a quick look, that looks like the same as I did, although I'm > using a saxon9he.jar file. To ask maybe a dumb question, did you > restart Cocoon after adding the jar? No, I assumed any change would force Tomcat to reread it all. I can restart Tomcat but I'm not aware of how to restart Cocoon itself. ///Peter > >> -Original Message- >> From: Peter Flynn [mailto:pfl...@ucc.ie] >> Sent: Thursday, December 16, 2010 9:58 AM >> To: users@cocoon.apache.org >> Subject: Switching to Saxon >> >> I just tried this, but there seems to be a lack of up-to-date details >> on >> doing this in Cocoon 2.1.11 with saxon9. Following the assorted web >> pages for earlier versions, I got as far as adding saxon9.jar to >> Cocoon's WEB-INF/lib and editing the two files (commenting out the >> Xalan >> entries): >> >> - cocoon.xconf: >> >> > role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" >> class="org.apache.cocoon.components.xslt.TraxProcessor"> >> >> > value="net.sf.saxon.TransformerFactoryImpl"/> >> >> >> - sitemap.xmap: >> >> > pool-min="8" logger="sitemap.transformer.xslt" >> src="org.apache.cocoon.transformation.TraxTransformer"> >> false >> false >> false >> false >> saxon >> true >> >> >> But then Cocoon spits out: >> >>> Internal Server Error >>> Message: Could not find component (key >> [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) >>> Description: org.apache.cocoon.ProcessingException: Lookup of >> transformer 'xslt' failed at - >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 >>> Sender: org.apache.cocoon.servlet.CocoonServlet >>> Source: Cocoon Servlet >>> >>> cause >>> org.apache.avalon.framework.component.ComponentException: Could not >> find component (key >> [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) >>> full exception chain stacktrace >>> org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt' >> failed >>> at - >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 >>> at >> org.apache.cocoon.ProcessingException.throwLocated(ProcessingException. >> java:113) >> >> What is it actually looking for when it says >> org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea what >> or where "org.apache.excalibur.xml.xslt.XSLTProcessor" points to (I'm >> sure it's possible to find out, but I'm not a Java programmer :-) >> >> ///Peter >> >> - >> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org >> For additional commands, e-mail: users-h...@cocoon.apache.org > - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: Switching to Saxon
Hello, Le 16/12/2010 16:58, Peter Flynn a écrit : > I just tried this, but there seems to be a lack of up-to-date details on > doing this in Cocoon 2.1.11 with saxon9. Following the assorted web > pages for earlier versions, I got as far as adding saxon9.jar to > Cocoon's WEB-INF/lib and editing the two files (commenting out the Xalan > entries): > > - cocoon.xconf: > > role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" > class="org.apache.cocoon.components.xslt.TraxProcessor"> > > value="net.sf.saxon.TransformerFactoryImpl"/> > > > - sitemap.xmap: > > pool-min="8" logger="sitemap.transformer.xslt" > src="org.apache.cocoon.transformation.TraxTransformer"> > false > false > false > false > saxon > true > > > But then Cocoon spits out: > >> Internal Server Error >> Message: Could not find component (key >> [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) >> Description: org.apache.cocoon.ProcessingException: Lookup of transformer >> 'xslt' failed at - >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 >> Sender: org.apache.cocoon.servlet.CocoonServlet >> Source: Cocoon Servlet >> >> cause >> org.apache.avalon.framework.component.ComponentException: Could not find >> component (key [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) >> full exception chain stacktrace >> org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt' failed >> at - >> file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 >> at >> org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:113) > > What is it actually looking for when it says > org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea what > or where "org.apache.excalibur.xml.xslt.XSLTProcessor" points to (I'm > sure it's possible to find out, but I'm not a Java programmer :-) > > ///Peter > Here is our configuration: cocoon.xconf: sitemap.xmap: false false false saxon8 true Hope that could help you :) Regards, -- Johan Cwiklinski AJLSM - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: Switching to Saxon
Taking a quick look, that looks like the same as I did, although I'm using a saxon9he.jar file. To ask maybe a dumb question, did you restart Cocoon after adding the jar? > -Original Message- > From: Peter Flynn [mailto:pfl...@ucc.ie] > Sent: Thursday, December 16, 2010 9:58 AM > To: users@cocoon.apache.org > Subject: Switching to Saxon > > I just tried this, but there seems to be a lack of up-to-date details > on > doing this in Cocoon 2.1.11 with saxon9. Following the assorted web > pages for earlier versions, I got as far as adding saxon9.jar to > Cocoon's WEB-INF/lib and editing the two files (commenting out the > Xalan > entries): > > - cocoon.xconf: > > role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" > class="org.apache.cocoon.components.xslt.TraxProcessor"> > > value="net.sf.saxon.TransformerFactoryImpl"/> > > > - sitemap.xmap: > > pool-min="8" logger="sitemap.transformer.xslt" > src="org.apache.cocoon.transformation.TraxTransformer"> > false > false > false > false > saxon > true > > > But then Cocoon spits out: > > > Internal Server Error > > Message: Could not find component (key > [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) > > Description: org.apache.cocoon.ProcessingException: Lookup of > transformer 'xslt' failed at - > file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 > > Sender: org.apache.cocoon.servlet.CocoonServlet > > Source: Cocoon Servlet > > > > cause > > org.apache.avalon.framework.component.ComponentException: Could not > find component (key > [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon]) > > full exception chain stacktrace > > org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt' > failed > > at - > file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71 > > at > org.apache.cocoon.ProcessingException.throwLocated(ProcessingException. > java:113) > > What is it actually looking for when it says > org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea what > or where "org.apache.excalibur.xml.xslt.XSLTProcessor" points to (I'm > sure it's possible to find out, but I'm not a Java programmer :-) > > ///Peter > > - > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org