Return-Path: X-Original-To: apmail-cocoon-users-archive@www.apache.org Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BC12DCBC for ; Thu, 8 Nov 2012 14:31:04 +0000 (UTC) Received: (qmail 82291 invoked by uid 500); 8 Nov 2012 14:31:04 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 82224 invoked by uid 500); 8 Nov 2012 14:31:03 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 82197 invoked by uid 99); 8 Nov 2012 14:31:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 14:31:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mansour.alakeel@gmail.com designates 209.85.217.179 as permitted sender) Received: from [209.85.217.179] (HELO mail-lb0-f179.google.com) (209.85.217.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 14:30:56 +0000 Received: by mail-lb0-f179.google.com with SMTP id c1so2104934lbg.24 for ; Thu, 08 Nov 2012 06:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=SoRaRvAXpTvsTXGSIZgktLC+fyYYS/B+KLO6Pru39JA=; b=WhsG1nDXoE7uCOZN5A0jscNgjZovQnTl35XIF6I8sn9qzv2BQOWHBA2o5nZMvHRwJA 8fj9mHE6waAJI1kZdVJR3uFWdoKO00ZrAgujROXGGF/fARZJ9jt8RnALz9OSJdm2aD9Y PtYiP0ut5GQu73tmo1cF0kve2XbmF9/dLkAqdI8va3uLez7zBR0UbSOxBJh38NamSnJ7 OOUb/wovtVfxrUAtiv2l3P8dd1cS2JDIMqi/ktRlyPJU/hk14YPDvGqz7EZVXTkg2tGc aygDEMerUnPzsiFiCIssH4aotLhWzFQC1o7l+AiSrIh6xHhkIYW4d5AyVyJJuu7R19s8 VOTg== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr7888213lab.9.1352385035956; Thu, 08 Nov 2012 06:30:35 -0800 (PST) Received: by 10.112.127.168 with HTTP; Thu, 8 Nov 2012 06:30:35 -0800 (PST) In-Reply-To: References: <927C66C0775CCA43B88EB1E3006614B3BE66EB69@eu1rdcrdc1wx032.exi.nxp.com> <927C66C0775CCA43B88EB1E3006614B3BE66ECF7@eu1rdcrdc1wx032.exi.nxp.com> Date: Thu, 8 Nov 2012 09:30:35 -0500 Message-ID: Subject: Re: Unable to transform to docbook From: Mansour Al Akeel To: users@cocoon.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Robby, I created a small unit test yesterday, and created a patch for the solution= . https://issues.apache.org/jira/browse/COCOON3-108 I think a small unit test doesn't show the real issue. I will test it with docbook xsl today. On Thu, Nov 8, 2012 at 4:11 AM, Robby Pelssers wro= te: > Hi Mansour, > > I just wrote a little unit test which has no issues with includes. I did= not commit the test but I suggest you try tackling your issue in small ste= ps like below and continue from there. > > Robby > > *************************************************************************= ********************* > package org.apache.cocoon.sax; > > import junit.framework.TestCase; > import org.custommonkey.xmlunit.Diff; > > import java.io.ByteArrayOutputStream; > > import static org.apache.cocoon.sax.builder.SAXPipelineBuilder.newNonCach= ingPipeline; > > > public class XSLTIncludeTest extends TestCase { > > public void testTransformerWithInclude() throws Exception { > ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); > > newNonCachingPipeline() > .setStringGenerator("appletomato") > .addXSLTTransformer(this.getClass().getResource("/food.xs= lt")) > .addSerializer() > .withEmptyConfiguration() > .setup(baos) > .execute(); > > Diff diff =3D new Diff("
  • apple
  • tomato
", new String(baos.toByteArray())); > assertTrue("XSL transformation didn't work as expected " + diff, = diff.identical()); > } > > } > **********************************food.xslt *****************************= **************** > > > > > > > > > > > > >
    > >
>
> > >
  • >
    > >
    > > ************************************vegetables.xslt**********************= ************************ > > > > >
  • >
    > >
    > > *************************************************************************= ********************* > > > > -----Original Message----- > From: Robby Pelssers [mailto:Robby.Pelssers@nxp.com] > Sent: Thursday, November 08, 2012 9:31 AM > To: users@cocoon.apache.org > Subject: RE: Unable to transform to docbook > > Hi Mansour, > > To be able to confirm this one would need to setup a small test case with= a very simple XSLT importing another one. Which is exactly what I am plan= ning to do. > > Too bad you can't send me a very simplistic project showing the problem. > > Robby > > -----Original Message----- > From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com] > Sent: Thursday, November 08, 2012 2:46 AM > To: users@cocoon.apache.org > Subject: Re: Unable to transform to docbook > > Robby, I think I know where the issue is, but I don't have eclipse set up= . I am just browsing the source through VI. > > I am working with the latest from SVN: > > In the file: cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSL= TTransformer.java > > try { > 160 this.templates =3D > transformerFactory.newTemplates(new > StreamSource(this.source.toExternalForm())); > 161 > 162 // store the XSLT into the cache for future reuse > 163 LOG.debug("{} local cache put: {}", > getClass().getSimpleName(), this.source.toExternalForm()); > 164 > 165 ValidityValue cacheEntry =3D new > ValidityValue(this.templates, lastModified); > 166 XSLT_CACHE.put(this.source.toExternalForm(), cacheEnt= ry); > 167 } catch (TransformerConfigurationException e) { > 168 throw new SetupException("Impossible to read XSLT > from '" + this.source.toExternalForm() > 169 + "', see nested exception", e); > 170 } > > > If I am not wrong, it's building the transformation from a stream, and a = SourceStream has no idea about the location of the loaded XSTL, so the reso= lver can not load the imported or included, xslts. > > The only way I know of, is to set the systemId so something like this sho= uld do the trick: > > StreamSource tmpSource =3D new StreamSource(this.source.toExternalForm())= ; > URL fullPath =3D ..... > tmpSource.setSystemId(fullPath); > this.templates =3D transformerFactory.newTemplates(tmpSource); > > > if you have eclipse and your IDE setup, it will be easier to test and fix= . > > > > On Mon, Nov 5, 2012 at 7:23 PM, Mansour Al Akeel wrote: >> Sure I will. I will organize a project that is easy to play with. >> >> I will send it directly to your email (I think the list doesn't allow >> attachment). >> >> >> On Mon, Nov 5, 2012 at 6:21 PM, Robby Pelssers = wrote: >>> You know what... >>> >>> It might be a problem with the includes but to be honest I would have e= xpected another exception in that case. Is there any way you can share the = sources for the project so I can adjust the dev.properties file for my situ= ation and crack the problem? I'm sure I will find out quickly but helping = out by mail is a bit more tedious to be honest. >>> >>> So if you can provide me with a zip file containing the project and the= docbook xslt's zipped and perhaps also that ex.xml file I can debug your i= ssue. >>> >>> Robby >>> >>> -----Original Message----- >>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com] >>> Sent: Monday, November 05, 2012 6:59 PM >>> To: users@cocoon.apache.org >>> Subject: Re: Unable to transform to docbook >>> >>> On Mon, Nov 5, 2012 at 7:51 AM, Robby Pelssers = wrote: >>>> Hi Mansour, >>>> >>>> First of all I assume you don't have the same match patterns in the sa= me sitemap..right? I guess you altered the implementation just to test and = the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) w= orked. >>> >>> Yes, exactly ! The first one is failing, the second one is working. So = the issue is only with docbook.xsl being processed from cocoon. >>> >>>> >>>> The most obvious way to debug is to try what following matchers will d= o: >>>> >>>> >>>> >>>> >>>> >>>> >>>> Also try to generate that xsl: >>>> >>>> >>>> >>>> >>>> >>>> >>>> But my hunch is that the docbook.xsl has other xsl imports or includes= which might be the problem. >>>> >>>> Let me know what happens if you try above matchers and also check if t= he docbookx.xsl has imports/includes or if it has declared xsl parameters. >>> >>> >>> I tried both matchers and they seem to be working fine. I can do http:/= /localhost:8888/transform/docbook.xsl and I get the expected output. >>> The docbook.xsl has a lot of : >>> >>> >> xmlns:ng=3D"http://docbook.org/docbook-ng" >>> xmlns:db=3D"http://docbook.org/ns/docbook" >>> xmlns:exsl=3D"http://exslt.org/common" >>> xmlns:exslt=3D"http://exslt.org/common" exclude-result-prefixes=3D"db n= g >>> exsl exslt" version=3D"1.0"> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> href=3D"../common/common.xsl"/> >> href=3D"../common/utility.xsl"/> >> href=3D"../common/labels.xsl"/> >> href=3D"../common/titles.xsl"/> >> href=3D"../common/subtitles.xsl"/> >>> >>> >> href=3D"../common/targets.xsl"/> >> href=3D"../common/olink.xsl"/> >>> >>> >>> .... >>> >>> Thank you for helping in this. >>> >>> >>> >>>> >>>> Kind regards, >>>> Robby Pelssers >>>> >>>> -----Original Message----- >>>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com] >>>> Sent: Sunday, November 04, 2012 11:14 PM >>>> To: users >>>> Subject: Unable to transform to docbook >>>> >>>> I have worked with C2.1 and 2.2 before. I am trying to play with C3 fo= r a coming project. >>>> I need to generate HTML from docbook file. >>>> >>>> INFO RequestProcessor - Sitemap execution for /article/ex took 6470.7= 27 ms. >>>> ERROR XMLSitemapServlet - Cocoon can't process the request. >>>> org.apache.cocoon.sitemap.InvocationException: >>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connec= tion file:/home/mansour/workspace/pipelines/repo/articles/ex.xml >>>> at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocati= onException(ExceptionHandler.java:39) >>>> at org.apache.cocoon.sitemap.node.PipelineNode.handleException= (PipelineNode.java:101) >>>> at org.apache.cocoon.sitemap.node.PipelineNode.invoke(Pipeline= Node.java:71) >>>> at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(A= bstractSitemapNode.java:96) >>>> at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(Pipelin= esNode.java:49) >>>> at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(A= bstractSitemapNode.java:96) >>>> at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:= 42) >>>> at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestPr= ocessor.java:233) >>>> at org.apache.cocoon.servlet.RequestProcessor.sendSitemapRespo= nse(RequestProcessor.java:290) >>>> at org.apache.cocoon.servlet.RequestProcessor.service(RequestP= rocessor.java:90) >>>> at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSite= mapServlet.java:47) >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820= ) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcc= essorImpl.java:57) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce >>>> ss >>>> orImpl.java:43) >>>> >>>> ..... >>>> >>>> Caused by: org.apache.cocoon.pipeline.ProcessingException: Can't parse= url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml >>>> at org.apache.cocoon.sax.util.XMLUtils.toSax(XMLUtils.java:117= ) >>>> at org.apache.cocoon.sax.component.XMLGenerator$URLGenerator.e= xecute(XMLGenerator.java:385) >>>> at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGen= erator.java:104) >>>> at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(A= bstractPipeline.java:146) >>>> at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingP= ipeline.java:143) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcc= essorImpl.java:57) >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingM= ethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:601) >>>> at org.springframework.aop.support.AopUtils.invokeJoinpointUsi= ngReflection(AopUtils.java:309) >>>> at org.springframework.aop.framework.ReflectiveMethodInvocatio= n.invokeJoinpoint(ReflectiveMethodInvocation.java:183) >>>> at org.springframework.aop.framework.ReflectiveMethodInvocatio= n.proceed(ReflectiveMethodInvocation.java:150) >>>> at org.springframework.aop.aspectj.MethodInvocationProceedingJ= oinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) >>>> at org.apache.cocoon.servlet.collector.ResponseHeaderCollector= .interceptInvoke(ResponseHeaderCollector.java:94) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcc= essorImpl.java:57) >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingM= ethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:601) >>>> at org.springframework.aop.aspectj.AbstractAspectJAdvice.invok= eAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) >>>> at org.springframework.aop.aspectj.AbstractAspectJAdvice.invok= eAdviceMethod(AbstractAspectJAdvice.java:610) >>>> at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(= AspectJAroundAdvice.java:65) >>>> at org.springframework.aop.framework.ReflectiveMethodInvocatio= n.proceed(ReflectiveMethodInvocation.java:172) >>>> at org.springframework.aop.interceptor.ExposeInvocationInterce= ptor.invoke(ExposeInvocationInterceptor.java:89) >>>> at org.springframework.aop.framework.ReflectiveMethodInvocatio= n.proceed(ReflectiveMethodInvocation.java:172) >>>> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke= (JdkDynamicAopProxy.java:202) >>>> at $Proxy27.execute(Unknown Source) >>>> at org.apache.cocoon.sitemap.InvocationImpl.execute(Invocation= Impl.java:141) >>>> at org.apache.cocoon.sitemap.node.PipelineNode.invoke(Pipeline= Node.java:66) >>>> ... 60 more >>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException >>>> javax.xml.transform.TransformerException: java.lang.NullPointerExcepti= on >>>> at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHan= dlerImpl.endDocument(TransformerHandlerImpl.java:245) >>>> at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(Abstr= actSAXPipe.java:58) >>>> at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(Ab= stractSAXTransformer.java:47) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocu >>>> me >>>> nt(AbstractSAXParser.java:742) >>>> >>>> ...... >>>> >>>> Here's my pipeline: >>>> >>>> >>>> >>>> >>>> >>>> >>> src=3D"/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" /= > >>>> >>> src=3D"/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/doc= book.xsl" >>>> /> >>>> >>>> >>>> >>>> >>>> This matcher is working with another transformation. >>>> For example the following pipeline: >>>> >>>> >>>> >>>> >>>> >>> src=3D"/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" /= > >>>> >>>> >>>> >>>> >>>> Would work fine. >>>> >>>> The same file "ex.xml" can be processed with xalan from the command li= ne and produce the correct output ! >>>> >>>> any idea ?? >>>> >>>> -------------------------------------------------------------------- >>>> - To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >>>> For additional commands, e-mail: users-help@cocoon.apache.org >>>> >>>> >>>> -------------------------------------------------------------------- >>>> - To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >>>> For additional commands, e-mail: users-help@cocoon.apache.org >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >>> For additional commands, e-mail: users-help@cocoon.apache.org >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >>> For additional commands, e-mail: users-help@cocoon.apache.org >>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org