You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2012/11/04 23:14:21 UTC

Unable to transform to docbook

I have worked with C2.1 and 2.2 before. I am trying to play with C3
for a coming project.
I need to generate HTML from docbook file.

INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
ERROR XMLSitemapServlet - Cocoon can't process the request.
org.apache.cocoon.sitemap.InvocationException:
org.apache.cocoon.pipeline.ProcessingException: Can't parse url
connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
        at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
        at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
        at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
        at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
        at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
        at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
        at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
        at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
        at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
        at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
        at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.execute(XMLGenerator.java:385)
        at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
        at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
        at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
        at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
        ... 60 more
Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
javax.xml.transform.TransformerException: java.lang.NullPointerException
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
        at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
        at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:742)

......

Here's my pipeline:

  <map:pipelines>
        <map:pipeline>

            <map:match pattern="article/{id}">
                <map:generate
src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
                <map:transform
src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
/>
                <map:serialize />
            </map:match>


This matcher is working with another transformation.
For example the following pipeline:

        <map:pipeline>

            <map:match pattern="article/{id}">
                <map:generate
src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
                <map:transform src="sheets/myCustomSheet.xsl" />
                <map:serialize />
            </map:match>

Would work fine.

The same file "ex.xml" can be processed with xalan from the command
line 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
I agree. This could be a common use. Additionally, I saw on the list
someone asking for saxon.
I think using this configuration, someone can plugin saxon for any of
their block. I didn't test it, but I think it should work.
Adding a FAQ item, for saxon will be good idea.


On Tue, Nov 13, 2012 at 3:13 AM, Francesco Chicchiriccò
<il...@apache.org> wrote:
> On 11/11/2012 18:14, Mansour Al Akeel wrote:
>> Ok Finally issue resolved.
>
> I've opened COCOON3-109 for reporting this to the website - this is
> quite a common use case, I'd say.
>
> Regards.
>
>> It looks like I am able to use docbook. Here's the steps to do so.
>>
>> There's a file cocoon_source/cocoon/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
>>
>> This file contains the value: org.apache.xalan.xsltc.trax.TransformerFactoryImpl
>>
>> If you need to use the default xalan factory, then you need to change it to.
>>
>> org.apache.xalan.processor.TransformerFactoryImpl
>>
>>
>> Now your unit tests should create Transformer Factory using the new
>> value "org.apache.xalan.processor.TransformerFactoryImpl"
>>
>> If you need to do this in your block, then copy this file to
>> META-INF/services in your block.
>>
>> This is a good an easy way to switch factories. I hope it helps
>> someone else stuck with complex XSLTs like docbook-xsl.
>>
>> Thank you all.
>>
>>
>>
>>
>> On Sun, Nov 11, 2012 at 10:43 AM, Mansour Al Akeel
>> <ma...@gmail.com> wrote:
>>> After googling for sometime, I found this related issue:
>>>
>>> https://lists.oasis-open.org/archives/docbook-apps/201006/msg00162.html
>>>
>>> The suggested solution was to disable compiling xslt or use saxon:
>>>
>>> ====================================
>>> Well, XSLTC is known to have problems with really complex
>>> transformations like DocBook XSL stylesheets. If you are in Java
>>> environment it is recommended to use Saxon, you can also use Xalan
>>> (normal version, not compiled).
>>> ====================================
>>>
>>> AFAIK, C3.0 doesn't have saxon as an option, so I will have to disable
>>> xslt compilation.
>>> Is there a way to do so ??
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Nov 11, 2012 at 1:28 AM, Mansour Al Akeel
>>> <ma...@gmail.com> wrote:
>>>> Robby, here's the code I am using for my test case. Nothing fancy,
>>>> just to be able to debug loading the xslt:
>>>>
>>>>
>>>>         @Test
>>>>         public void docbookTest() throws Exception {
>>>>                 Cache cache = new SimpleCache();
>>>>
>>>>                 CachingPipeline<SAXPipelineComponent> pipeline = new
>>>> CachingPipeline<SAXPipelineComponent>();
>>>>                 pipeline.setCache(cache);
>>>>
>>>>                 pipeline.addComponent(new XMLGenerator(getClass().getResource(
>>>>                                 "/article.xml")));
>>>>
>>>>                 URL xsltURL = new
>>>> URL("file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl");
>>>>
>>>>                 XSLTTransformer xslt = new XSLTTransformer(xsltURL);
>>>>
>>>>                 pipeline.addComponent(xslt);
>>>>
>>>>                 pipeline.addComponent(XMLSerializer.createXMLSerializer());
>>>>
>>>>                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>>                 pipeline.setup(baos);
>>>>                 pipeline.execute();
>>>>
>>>>         }
>>>>
>>>>
>>>> here's the error I am getting:
>>>>
>>>>
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 939: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1063: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1193: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1193: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1294: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1332: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 283: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 283: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 353: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 353: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>>>> line 117: Attribute 'onClick' outside of element.
>>>> ERROR:  'Cannot find external method
>>>> 'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
>>>> FATAL ERROR:  'Could not compile stylesheet'
>>>> javax.xml.transform.TransformerConfigurationException: Could not
>>>> compile stylesheet
>>>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>
>>>>
>>>> I downgraded to xalan-2.7.0 in the parent/pom.xml to give it a try,
>>>> but now I am getting this error:
>>>>
>>>>
>>>> 06:18:30.599 [main] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
>>>> Adding component XMLGenerator(hashCode=1538386262
>>>> internalGenerator=URLGenerator(hashCode=782702191
>>>> source=file:/home/mansour/workspace/sources/cocoon/cocoon-sax/target/test-classes/article.xml))
>>>> to pipeline [CachingPipeline(hashCode=341284117 components=[])].
>>>> 06:18:31.597 [main] DEBUG o.a.c.sax.component.XSLTTransformer -
>>>> XSLTTransformer local cache miss:
>>>> file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl
>>>> Compiler warnings:
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>>> line 610: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>>> line 662: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>>> line 662: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>>> line 686: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>>> line 686: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/lists.xsl:
>>>> line 862: Attribute 'type' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/callout.xsl:
>>>> line 116: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>>>> line 188: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>>>> line 1017: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>>>> line 211: Attribute 'id' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>>>> line 435: Attribute 'id' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/htmltbl.xsl:
>>>> line 20: Attribute 'id' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 108: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 108: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 144: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 144: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 184: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 184: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 714: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 939: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1063: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1193: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1193: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1294: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>>> line 1332: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 283: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 283: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 353: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>>> line 353: Attribute 'href' outside of element.
>>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>>>> line 117: Attribute 'onClick' outside of element.
>>>> ERROR:  'Syntax error in '* or $generate.index != 0'.'
>>>> FATAL ERROR:  'Could not compile stylesheet'
>>>> javax.xml.transform.TransformerConfigurationException: Could not
>>>> compile stylesheet
>>>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>
>>>>
>>>>
>>>> On Thu, Nov 8, 2012 at 9:34 AM, Robby Pelssers <Ro...@nxp.com> wrote:
>>>>> I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.
>>>>>
>>>>> Robby
>>>>>
>>>>> -----Original Message-----
>>>>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com]
>>>>> Sent: Thursday, November 08, 2012 3:31 PM
>>>>> To: users@cocoon.apache.org
>>>>> Subject: Re: Unable to transform to docbook
>>>>>
>>>>> 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 <Ro...@nxp.com> wrote:
>>>>>> 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 steps 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.newNonCachingPipeline
>>>>>> ;
>>>>>>
>>>>>>
>>>>>> public class XSLTIncludeTest extends TestCase  {
>>>>>>
>>>>>>     public void testTransformerWithInclude() throws Exception {
>>>>>>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>>>>
>>>>>>         newNonCachingPipeline()
>>>>>>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>>>>>>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>>>>>>                 .addSerializer()
>>>>>>                 .withEmptyConfiguration()
>>>>>>                 .setup(baos)
>>>>>>                 .execute();
>>>>>>
>>>>>>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>>>>>>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>>>>>>     }
>>>>>>
>>>>>> }
>>>>>> **********************************food.xslt
>>>>>> *********************************************
>>>>>> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
>>>>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>>>>>
>>>>>>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>>>>>>        to the included vegetables.xslt -->
>>>>>>
>>>>>>   <xsl:include href="vegetables.xslt"/>
>>>>>>
>>>>>>   <xsl:template match="/">
>>>>>>     <xsl:apply-templates/>
>>>>>>   </xsl:template>
>>>>>>
>>>>>>   <xsl:template match="food">
>>>>>>     <ul>
>>>>>>        <xsl:apply-templates/>
>>>>>>     </ul>
>>>>>>   </xsl:template>
>>>>>>
>>>>>>   <xsl:template match="fruit">
>>>>>>     <li class="fruit"><xsl:apply-templates/></li>
>>>>>>   </xsl:template>
>>>>>>
>>>>>> </xsl:stylesheet>
>>>>>>
>>>>>> ************************************vegetables.xslt*******************
>>>>>> *************************** <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>>> version="1.0">
>>>>>>
>>>>>>   <xsl:template match="vegetable">
>>>>>>     <li class="vegetable"><xsl:apply-templates/></li>
>>>>>>   </xsl:template>
>>>>>>
>>>>>> </xsl:stylesheet>
>>>>>>
>>>>>> **********************************************************************
>>>>>> ************************
>>>>>>
>>>>>>
>>>>>>
>>>>>> -----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 planning 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/XSLTTransform
>>>>>> er.java
>>>>>>
>>>>>>           try {
>>>>>> 160                 this.templates =
>>>>>> 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<Templates> cacheEntry = new
>>>>>> ValidityValue<Templates>(this.templates, lastModified);
>>>>>> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
>>>>>> 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 resolver can not load the imported or included, xslts.
>>>>>>
>>>>>> The only way I know of, is to set the systemId so something like this should do the trick:
>>>>>>
>>>>>> StreamSource tmpSource = new
>>>>>> StreamSource(this.source.toExternalForm());
>>>>>> URL fullPath =  .....
>>>>>> tmpSource.setSystemId(fullPath);
>>>>>> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>>>>>>> You know what...
>>>>>>>>
>>>>>>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>>>>>>
>>>>>>>> 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 <Ro...@nxp.com> wrote:
>>>>>>>>> Hi Mansour,
>>>>>>>>>
>>>>>>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>>>>>> 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 do:
>>>>>>>>>
>>>>>>>>> <map:match pattern="article/{id}">
>>>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>>   <map:serialize />
>>>>>>>>> </map:match>
>>>>>>>>>
>>>>>>>>> Also try to generate that xsl:
>>>>>>>>>
>>>>>>>>> <map:match pattern="transform/docbook.xsl">
>>>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>>>>>>   <map:serialize />
>>>>>>>>> </map:match>
>>>>>>>>>
>>>>>>>>> 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 the 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 <xsl:include> :
>>>>>>>>
>>>>>>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>>>>> xmlns:ng="http://docbook.org/docbook-ng"
>>>>>>>> xmlns:db="http://docbook.org/ns/docbook"
>>>>>>>> xmlns:exsl="http://exslt.org/common"
>>>>>>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>>>>>>> exsl exslt" version="1.0">
>>>>>>>>
>>>>>>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>>>>>>
>>>>>>>> <!-- ********************************************************************
>>>>>>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>>>>>>
>>>>>>>> ********************************************************************
>>>>>>>>
>>>>>>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>>>>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>>>>>>      copyright and other information.
>>>>>>>>
>>>>>>>>
>>>>>>>> ********************************************************************
>>>>>>>> -->
>>>>>>>>
>>>>>>>> <!--
>>>>>>>> ====================================================================
>>>>>>>> -->
>>>>>>>>
>>>>>>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/>
>>>>>>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include
>>>>>>>> href="../common/l10n.xsl"/> <xsl:include
>>>>>>>> href="../common/common.xsl"/> <xsl:include
>>>>>>>> href="../common/utility.xsl"/> <xsl:include
>>>>>>>> href="../common/labels.xsl"/> <xsl:include
>>>>>>>> href="../common/titles.xsl"/> <xsl:include
>>>>>>>> href="../common/subtitles.xsl"/>
>>>>>>>>
>>>>>>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>>>>>>> href="../common/targets.xsl"/> <xsl:include
>>>>>>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>>>>>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>>>>>>> I need to generate HTML from docbook file.
>>>>>>>>>
>>>>>>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>>>>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>>>>>>> org.apache.cocoon.sitemap.InvocationException:
>>>>>>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>>>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>>>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>>>         at
>>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>>>>>>> e
>>>>>>>>> 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.execute(XMLGenerator.java:385)
>>>>>>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>>>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>>>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>>>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>>>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>>>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>>>>>>         ... 60 more
>>>>>>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>>>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>>>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>>>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>>>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>>>>>>         at
>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>>>>>>> u
>>>>>>>>> me
>>>>>>>>> nt(AbstractSAXParser.java:742)
>>>>>>>>>
>>>>>>>>> ......
>>>>>>>>>
>>>>>>>>> Here's my pipeline:
>>>>>>>>>
>>>>>>>>>   <map:pipelines>
>>>>>>>>>         <map:pipeline>
>>>>>>>>>
>>>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>>>                 <map:generate
>>>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>>                 <map:transform
>>>>>>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>>>>>>> />
>>>>>>>>>                 <map:serialize />
>>>>>>>>>             </map:match>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> This matcher is working with another transformation.
>>>>>>>>> For example the following pipeline:
>>>>>>>>>
>>>>>>>>>         <map:pipeline>
>>>>>>>>>
>>>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>>>                 <map:generate
>>>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>>>>>>                 <map:serialize />
>>>>>>>>>             </map:match>
>>>>>>>>>
>>>>>>>>> Would work fine.
>>>>>>>>>
>>>>>>>>> The same file "ex.xml" can be processed with xalan from the command line and produce the correct output !
>>>>>>>>>
>>>>>>>>> any idea ??
>
> --
> Francesco Chicchiriccò
>
> ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
> http://people.apache.org/~ilgrosso/
>
>
> ---------------------------------------------------------------------
> 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


Re: Unable to transform to docbook

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 11/11/2012 18:14, Mansour Al Akeel wrote:
> Ok Finally issue resolved.

I've opened COCOON3-109 for reporting this to the website - this is
quite a common use case, I'd say.

Regards.

> It looks like I am able to use docbook. Here's the steps to do so.
>
> There's a file cocoon_source/cocoon/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
>
> This file contains the value: org.apache.xalan.xsltc.trax.TransformerFactoryImpl
>
> If you need to use the default xalan factory, then you need to change it to.
>
> org.apache.xalan.processor.TransformerFactoryImpl
>
>
> Now your unit tests should create Transformer Factory using the new
> value "org.apache.xalan.processor.TransformerFactoryImpl"
>
> If you need to do this in your block, then copy this file to
> META-INF/services in your block.
>
> This is a good an easy way to switch factories. I hope it helps
> someone else stuck with complex XSLTs like docbook-xsl.
>
> Thank you all.
>
>
>
>
> On Sun, Nov 11, 2012 at 10:43 AM, Mansour Al Akeel
> <ma...@gmail.com> wrote:
>> After googling for sometime, I found this related issue:
>>
>> https://lists.oasis-open.org/archives/docbook-apps/201006/msg00162.html
>>
>> The suggested solution was to disable compiling xslt or use saxon:
>>
>> ====================================
>> Well, XSLTC is known to have problems with really complex
>> transformations like DocBook XSL stylesheets. If you are in Java
>> environment it is recommended to use Saxon, you can also use Xalan
>> (normal version, not compiled).
>> ====================================
>>
>> AFAIK, C3.0 doesn't have saxon as an option, so I will have to disable
>> xslt compilation.
>> Is there a way to do so ??
>>
>>
>>
>>
>>
>> On Sun, Nov 11, 2012 at 1:28 AM, Mansour Al Akeel
>> <ma...@gmail.com> wrote:
>>> Robby, here's the code I am using for my test case. Nothing fancy,
>>> just to be able to debug loading the xslt:
>>>
>>>
>>>         @Test
>>>         public void docbookTest() throws Exception {
>>>                 Cache cache = new SimpleCache();
>>>
>>>                 CachingPipeline<SAXPipelineComponent> pipeline = new
>>> CachingPipeline<SAXPipelineComponent>();
>>>                 pipeline.setCache(cache);
>>>
>>>                 pipeline.addComponent(new XMLGenerator(getClass().getResource(
>>>                                 "/article.xml")));
>>>
>>>                 URL xsltURL = new
>>> URL("file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl");
>>>
>>>                 XSLTTransformer xslt = new XSLTTransformer(xsltURL);
>>>
>>>                 pipeline.addComponent(xslt);
>>>
>>>                 pipeline.addComponent(XMLSerializer.createXMLSerializer());
>>>
>>>                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>                 pipeline.setup(baos);
>>>                 pipeline.execute();
>>>
>>>         }
>>>
>>>
>>> here's the error I am getting:
>>>
>>>
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 939: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1063: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1193: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1193: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1294: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1332: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 283: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 283: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 353: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 353: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>>> line 117: Attribute 'onClick' outside of element.
>>> ERROR:  'Cannot find external method
>>> 'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
>>> FATAL ERROR:  'Could not compile stylesheet'
>>> javax.xml.transform.TransformerConfigurationException: Could not
>>> compile stylesheet
>>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>
>>>
>>> I downgraded to xalan-2.7.0 in the parent/pom.xml to give it a try,
>>> but now I am getting this error:
>>>
>>>
>>> 06:18:30.599 [main] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
>>> Adding component XMLGenerator(hashCode=1538386262
>>> internalGenerator=URLGenerator(hashCode=782702191
>>> source=file:/home/mansour/workspace/sources/cocoon/cocoon-sax/target/test-classes/article.xml))
>>> to pipeline [CachingPipeline(hashCode=341284117 components=[])].
>>> 06:18:31.597 [main] DEBUG o.a.c.sax.component.XSLTTransformer -
>>> XSLTTransformer local cache miss:
>>> file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl
>>> Compiler warnings:
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>> line 610: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>> line 662: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>> line 662: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>> line 686: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>>> line 686: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/lists.xsl:
>>> line 862: Attribute 'type' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/callout.xsl:
>>> line 116: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>>> line 188: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>>> line 1017: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>>> line 211: Attribute 'id' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>>> line 435: Attribute 'id' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/htmltbl.xsl:
>>> line 20: Attribute 'id' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 108: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 108: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 144: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 144: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 184: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 184: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 714: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 939: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1063: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1193: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1193: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1294: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>>> line 1332: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 283: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 283: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 353: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>>> line 353: Attribute 'href' outside of element.
>>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>>> line 117: Attribute 'onClick' outside of element.
>>> ERROR:  'Syntax error in '* or $generate.index != 0'.'
>>> FATAL ERROR:  'Could not compile stylesheet'
>>> javax.xml.transform.TransformerConfigurationException: Could not
>>> compile stylesheet
>>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>
>>>
>>>
>>> On Thu, Nov 8, 2012 at 9:34 AM, Robby Pelssers <Ro...@nxp.com> wrote:
>>>> I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.
>>>>
>>>> Robby
>>>>
>>>> -----Original Message-----
>>>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com]
>>>> Sent: Thursday, November 08, 2012 3:31 PM
>>>> To: users@cocoon.apache.org
>>>> Subject: Re: Unable to transform to docbook
>>>>
>>>> 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 <Ro...@nxp.com> wrote:
>>>>> 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 steps 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.newNonCachingPipeline
>>>>> ;
>>>>>
>>>>>
>>>>> public class XSLTIncludeTest extends TestCase  {
>>>>>
>>>>>     public void testTransformerWithInclude() throws Exception {
>>>>>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>>>
>>>>>         newNonCachingPipeline()
>>>>>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>>>>>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>>>>>                 .addSerializer()
>>>>>                 .withEmptyConfiguration()
>>>>>                 .setup(baos)
>>>>>                 .execute();
>>>>>
>>>>>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>>>>>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>>>>>     }
>>>>>
>>>>> }
>>>>> **********************************food.xslt
>>>>> *********************************************
>>>>> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
>>>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>>>>
>>>>>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>>>>>        to the included vegetables.xslt -->
>>>>>
>>>>>   <xsl:include href="vegetables.xslt"/>
>>>>>
>>>>>   <xsl:template match="/">
>>>>>     <xsl:apply-templates/>
>>>>>   </xsl:template>
>>>>>
>>>>>   <xsl:template match="food">
>>>>>     <ul>
>>>>>        <xsl:apply-templates/>
>>>>>     </ul>
>>>>>   </xsl:template>
>>>>>
>>>>>   <xsl:template match="fruit">
>>>>>     <li class="fruit"><xsl:apply-templates/></li>
>>>>>   </xsl:template>
>>>>>
>>>>> </xsl:stylesheet>
>>>>>
>>>>> ************************************vegetables.xslt*******************
>>>>> *************************** <?xml version="1.0" encoding="UTF-8"?>
>>>>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>> version="1.0">
>>>>>
>>>>>   <xsl:template match="vegetable">
>>>>>     <li class="vegetable"><xsl:apply-templates/></li>
>>>>>   </xsl:template>
>>>>>
>>>>> </xsl:stylesheet>
>>>>>
>>>>> **********************************************************************
>>>>> ************************
>>>>>
>>>>>
>>>>>
>>>>> -----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 planning 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/XSLTTransform
>>>>> er.java
>>>>>
>>>>>           try {
>>>>> 160                 this.templates =
>>>>> 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<Templates> cacheEntry = new
>>>>> ValidityValue<Templates>(this.templates, lastModified);
>>>>> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
>>>>> 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 resolver can not load the imported or included, xslts.
>>>>>
>>>>> The only way I know of, is to set the systemId so something like this should do the trick:
>>>>>
>>>>> StreamSource tmpSource = new
>>>>> StreamSource(this.source.toExternalForm());
>>>>> URL fullPath =  .....
>>>>> tmpSource.setSystemId(fullPath);
>>>>> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>>>>>> You know what...
>>>>>>>
>>>>>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>>>>>
>>>>>>> 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 <Ro...@nxp.com> wrote:
>>>>>>>> Hi Mansour,
>>>>>>>>
>>>>>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>>>>> 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 do:
>>>>>>>>
>>>>>>>> <map:match pattern="article/{id}">
>>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>   <map:serialize />
>>>>>>>> </map:match>
>>>>>>>>
>>>>>>>> Also try to generate that xsl:
>>>>>>>>
>>>>>>>> <map:match pattern="transform/docbook.xsl">
>>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>>>>>   <map:serialize />
>>>>>>>> </map:match>
>>>>>>>>
>>>>>>>> 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 the 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 <xsl:include> :
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>>>> xmlns:ng="http://docbook.org/docbook-ng"
>>>>>>> xmlns:db="http://docbook.org/ns/docbook"
>>>>>>> xmlns:exsl="http://exslt.org/common"
>>>>>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>>>>>> exsl exslt" version="1.0">
>>>>>>>
>>>>>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>>>>>
>>>>>>> <!-- ********************************************************************
>>>>>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>>>>>
>>>>>>> ********************************************************************
>>>>>>>
>>>>>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>>>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>>>>>      copyright and other information.
>>>>>>>
>>>>>>>
>>>>>>> ********************************************************************
>>>>>>> -->
>>>>>>>
>>>>>>> <!--
>>>>>>> ====================================================================
>>>>>>> -->
>>>>>>>
>>>>>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/>
>>>>>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include
>>>>>>> href="../common/l10n.xsl"/> <xsl:include
>>>>>>> href="../common/common.xsl"/> <xsl:include
>>>>>>> href="../common/utility.xsl"/> <xsl:include
>>>>>>> href="../common/labels.xsl"/> <xsl:include
>>>>>>> href="../common/titles.xsl"/> <xsl:include
>>>>>>> href="../common/subtitles.xsl"/>
>>>>>>>
>>>>>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>>>>>> href="../common/targets.xsl"/> <xsl:include
>>>>>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>>>>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>>>>>> I need to generate HTML from docbook file.
>>>>>>>>
>>>>>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>>>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>>>>>> org.apache.cocoon.sitemap.InvocationException:
>>>>>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>>         at
>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>>>>>> e
>>>>>>>> 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.execute(XMLGenerator.java:385)
>>>>>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>>>>>         ... 60 more
>>>>>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>>>>>         at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>>>>>> u
>>>>>>>> me
>>>>>>>> nt(AbstractSAXParser.java:742)
>>>>>>>>
>>>>>>>> ......
>>>>>>>>
>>>>>>>> Here's my pipeline:
>>>>>>>>
>>>>>>>>   <map:pipelines>
>>>>>>>>         <map:pipeline>
>>>>>>>>
>>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>>                 <map:generate
>>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>                 <map:transform
>>>>>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>>>>>> />
>>>>>>>>                 <map:serialize />
>>>>>>>>             </map:match>
>>>>>>>>
>>>>>>>>
>>>>>>>> This matcher is working with another transformation.
>>>>>>>> For example the following pipeline:
>>>>>>>>
>>>>>>>>         <map:pipeline>
>>>>>>>>
>>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>>                 <map:generate
>>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>>>>>                 <map:serialize />
>>>>>>>>             </map:match>
>>>>>>>>
>>>>>>>> Would work fine.
>>>>>>>>
>>>>>>>> The same file "ex.xml" can be processed with xalan from the command line and produce the correct output !
>>>>>>>>
>>>>>>>> any idea ??

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
Ok Finally issue resolved.
It looks like I am able to use docbook. Here's the steps to do so.

There's a file cocoon_source/cocoon/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory

This file contains the value: org.apache.xalan.xsltc.trax.TransformerFactoryImpl

If you need to use the default xalan factory, then you need to change it to.

org.apache.xalan.processor.TransformerFactoryImpl


Now your unit tests should create Transformer Factory using the new
value "org.apache.xalan.processor.TransformerFactoryImpl"

If you need to do this in your block, then copy this file to
META-INF/services in your block.

This is a good an easy way to switch factories. I hope it helps
someone else stuck with complex XSLTs like docbook-xsl.

Thank you all.




On Sun, Nov 11, 2012 at 10:43 AM, Mansour Al Akeel
<ma...@gmail.com> wrote:
> After googling for sometime, I found this related issue:
>
> https://lists.oasis-open.org/archives/docbook-apps/201006/msg00162.html
>
> The suggested solution was to disable compiling xslt or use saxon:
>
> ====================================
> Well, XSLTC is known to have problems with really complex
> transformations like DocBook XSL stylesheets. If you are in Java
> environment it is recommended to use Saxon, you can also use Xalan
> (normal version, not compiled).
> ====================================
>
> AFAIK, C3.0 doesn't have saxon as an option, so I will have to disable
> xslt compilation.
> Is there a way to do so ??
>
>
>
>
>
> On Sun, Nov 11, 2012 at 1:28 AM, Mansour Al Akeel
> <ma...@gmail.com> wrote:
>> Robby, here's the code I am using for my test case. Nothing fancy,
>> just to be able to debug loading the xslt:
>>
>>
>>         @Test
>>         public void docbookTest() throws Exception {
>>                 Cache cache = new SimpleCache();
>>
>>                 CachingPipeline<SAXPipelineComponent> pipeline = new
>> CachingPipeline<SAXPipelineComponent>();
>>                 pipeline.setCache(cache);
>>
>>                 pipeline.addComponent(new XMLGenerator(getClass().getResource(
>>                                 "/article.xml")));
>>
>>                 URL xsltURL = new
>> URL("file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl");
>>
>>                 XSLTTransformer xslt = new XSLTTransformer(xsltURL);
>>
>>                 pipeline.addComponent(xslt);
>>
>>                 pipeline.addComponent(XMLSerializer.createXMLSerializer());
>>
>>                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>                 pipeline.setup(baos);
>>                 pipeline.execute();
>>
>>         }
>>
>>
>> here's the error I am getting:
>>
>>
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 939: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1063: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1193: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1193: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1294: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1332: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 283: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 283: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 353: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 353: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>> line 117: Attribute 'onClick' outside of element.
>> ERROR:  'Cannot find external method
>> 'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
>> FATAL ERROR:  'Could not compile stylesheet'
>> javax.xml.transform.TransformerConfigurationException: Could not
>> compile stylesheet
>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>>
>> I downgraded to xalan-2.7.0 in the parent/pom.xml to give it a try,
>> but now I am getting this error:
>>
>>
>> 06:18:30.599 [main] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
>> Adding component XMLGenerator(hashCode=1538386262
>> internalGenerator=URLGenerator(hashCode=782702191
>> source=file:/home/mansour/workspace/sources/cocoon/cocoon-sax/target/test-classes/article.xml))
>> to pipeline [CachingPipeline(hashCode=341284117 components=[])].
>> 06:18:31.597 [main] DEBUG o.a.c.sax.component.XSLTTransformer -
>> XSLTTransformer local cache miss:
>> file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl
>> Compiler warnings:
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>> line 610: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>> line 662: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>> line 662: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>> line 686: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
>> line 686: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/lists.xsl:
>> line 862: Attribute 'type' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/callout.xsl:
>> line 116: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>> line 188: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
>> line 1017: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>> line 211: Attribute 'id' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
>> line 435: Attribute 'id' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/htmltbl.xsl:
>> line 20: Attribute 'id' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 108: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 108: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 144: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 144: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 184: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 184: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 714: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 939: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1063: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1193: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1193: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1294: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
>> line 1332: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 283: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 283: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 353: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
>> line 353: Attribute 'href' outside of element.
>>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
>> line 117: Attribute 'onClick' outside of element.
>> ERROR:  'Syntax error in '* or $generate.index != 0'.'
>> FATAL ERROR:  'Could not compile stylesheet'
>> javax.xml.transform.TransformerConfigurationException: Could not
>> compile stylesheet
>>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>
>>
>> On Thu, Nov 8, 2012 at 9:34 AM, Robby Pelssers <Ro...@nxp.com> wrote:
>>> I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.
>>>
>>> Robby
>>>
>>> -----Original Message-----
>>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com]
>>> Sent: Thursday, November 08, 2012 3:31 PM
>>> To: users@cocoon.apache.org
>>> Subject: Re: Unable to transform to docbook
>>>
>>> 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 <Ro...@nxp.com> wrote:
>>>> 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 steps 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.newNonCachingPipeline
>>>> ;
>>>>
>>>>
>>>> public class XSLTIncludeTest extends TestCase  {
>>>>
>>>>     public void testTransformerWithInclude() throws Exception {
>>>>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>>
>>>>         newNonCachingPipeline()
>>>>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>>>>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>>>>                 .addSerializer()
>>>>                 .withEmptyConfiguration()
>>>>                 .setup(baos)
>>>>                 .execute();
>>>>
>>>>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>>>>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>>>>     }
>>>>
>>>> }
>>>> **********************************food.xslt
>>>> *********************************************
>>>> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
>>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>>>
>>>>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>>>>        to the included vegetables.xslt -->
>>>>
>>>>   <xsl:include href="vegetables.xslt"/>
>>>>
>>>>   <xsl:template match="/">
>>>>     <xsl:apply-templates/>
>>>>   </xsl:template>
>>>>
>>>>   <xsl:template match="food">
>>>>     <ul>
>>>>        <xsl:apply-templates/>
>>>>     </ul>
>>>>   </xsl:template>
>>>>
>>>>   <xsl:template match="fruit">
>>>>     <li class="fruit"><xsl:apply-templates/></li>
>>>>   </xsl:template>
>>>>
>>>> </xsl:stylesheet>
>>>>
>>>> ************************************vegetables.xslt*******************
>>>> *************************** <?xml version="1.0" encoding="UTF-8"?>
>>>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>> version="1.0">
>>>>
>>>>   <xsl:template match="vegetable">
>>>>     <li class="vegetable"><xsl:apply-templates/></li>
>>>>   </xsl:template>
>>>>
>>>> </xsl:stylesheet>
>>>>
>>>> **********************************************************************
>>>> ************************
>>>>
>>>>
>>>>
>>>> -----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 planning 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/XSLTTransform
>>>> er.java
>>>>
>>>>           try {
>>>> 160                 this.templates =
>>>> 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<Templates> cacheEntry = new
>>>> ValidityValue<Templates>(this.templates, lastModified);
>>>> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
>>>> 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 resolver can not load the imported or included, xslts.
>>>>
>>>> The only way I know of, is to set the systemId so something like this should do the trick:
>>>>
>>>> StreamSource tmpSource = new
>>>> StreamSource(this.source.toExternalForm());
>>>> URL fullPath =  .....
>>>> tmpSource.setSystemId(fullPath);
>>>> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>>>>> You know what...
>>>>>>
>>>>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>>>>
>>>>>> 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 <Ro...@nxp.com> wrote:
>>>>>>> Hi Mansour,
>>>>>>>
>>>>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>>>>
>>>>>> 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 do:
>>>>>>>
>>>>>>> <map:match pattern="article/{id}">
>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>   <map:serialize />
>>>>>>> </map:match>
>>>>>>>
>>>>>>> Also try to generate that xsl:
>>>>>>>
>>>>>>> <map:match pattern="transform/docbook.xsl">
>>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>>>>   <map:serialize />
>>>>>>> </map:match>
>>>>>>>
>>>>>>> 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 the 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 <xsl:include> :
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>>> xmlns:ng="http://docbook.org/docbook-ng"
>>>>>> xmlns:db="http://docbook.org/ns/docbook"
>>>>>> xmlns:exsl="http://exslt.org/common"
>>>>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>>>>> exsl exslt" version="1.0">
>>>>>>
>>>>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>>>>
>>>>>> <!-- ********************************************************************
>>>>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>>>>
>>>>>> ********************************************************************
>>>>>>
>>>>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>>>>      copyright and other information.
>>>>>>
>>>>>>
>>>>>> ********************************************************************
>>>>>> -->
>>>>>>
>>>>>> <!--
>>>>>> ====================================================================
>>>>>> -->
>>>>>>
>>>>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/>
>>>>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include
>>>>>> href="../common/l10n.xsl"/> <xsl:include
>>>>>> href="../common/common.xsl"/> <xsl:include
>>>>>> href="../common/utility.xsl"/> <xsl:include
>>>>>> href="../common/labels.xsl"/> <xsl:include
>>>>>> href="../common/titles.xsl"/> <xsl:include
>>>>>> href="../common/subtitles.xsl"/>
>>>>>>
>>>>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>>>>> href="../common/targets.xsl"/> <xsl:include
>>>>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>>>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>>>>> I need to generate HTML from docbook file.
>>>>>>>
>>>>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>>>>> org.apache.cocoon.sitemap.InvocationException:
>>>>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>         at
>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>>>>> e
>>>>>>> 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.execute(XMLGenerator.java:385)
>>>>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>>>>         ... 60 more
>>>>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>>>>         at
>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>>>>> u
>>>>>>> me
>>>>>>> nt(AbstractSAXParser.java:742)
>>>>>>>
>>>>>>> ......
>>>>>>>
>>>>>>> Here's my pipeline:
>>>>>>>
>>>>>>>   <map:pipelines>
>>>>>>>         <map:pipeline>
>>>>>>>
>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>                 <map:generate
>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>                 <map:transform
>>>>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>>>>> />
>>>>>>>                 <map:serialize />
>>>>>>>             </map:match>
>>>>>>>
>>>>>>>
>>>>>>> This matcher is working with another transformation.
>>>>>>> For example the following pipeline:
>>>>>>>
>>>>>>>         <map:pipeline>
>>>>>>>
>>>>>>>             <map:match pattern="article/{id}">
>>>>>>>                 <map:generate
>>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>>>>                 <map:serialize />
>>>>>>>             </map:match>
>>>>>>>
>>>>>>> Would work fine.
>>>>>>>
>>>>>>> The same file "ex.xml" can be processed with xalan from the command line 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
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
After googling for sometime, I found this related issue:

https://lists.oasis-open.org/archives/docbook-apps/201006/msg00162.html

The suggested solution was to disable compiling xslt or use saxon:

====================================
Well, XSLTC is known to have problems with really complex
transformations like DocBook XSL stylesheets. If you are in Java
environment it is recommended to use Saxon, you can also use Xalan
(normal version, not compiled).
====================================

AFAIK, C3.0 doesn't have saxon as an option, so I will have to disable
xslt compilation.
Is there a way to do so ??





On Sun, Nov 11, 2012 at 1:28 AM, Mansour Al Akeel
<ma...@gmail.com> wrote:
> Robby, here's the code I am using for my test case. Nothing fancy,
> just to be able to debug loading the xslt:
>
>
>         @Test
>         public void docbookTest() throws Exception {
>                 Cache cache = new SimpleCache();
>
>                 CachingPipeline<SAXPipelineComponent> pipeline = new
> CachingPipeline<SAXPipelineComponent>();
>                 pipeline.setCache(cache);
>
>                 pipeline.addComponent(new XMLGenerator(getClass().getResource(
>                                 "/article.xml")));
>
>                 URL xsltURL = new
> URL("file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl");
>
>                 XSLTTransformer xslt = new XSLTTransformer(xsltURL);
>
>                 pipeline.addComponent(xslt);
>
>                 pipeline.addComponent(XMLSerializer.createXMLSerializer());
>
>                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
>                 pipeline.setup(baos);
>                 pipeline.execute();
>
>         }
>
>
> here's the error I am getting:
>
>
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 939: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1063: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1193: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1193: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1294: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1332: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 283: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 283: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 353: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 353: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
> line 117: Attribute 'onClick' outside of element.
> ERROR:  'Cannot find external method
> 'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
> FATAL ERROR:  'Could not compile stylesheet'
> javax.xml.transform.TransformerConfigurationException: Could not
> compile stylesheet
>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
>
> I downgraded to xalan-2.7.0 in the parent/pom.xml to give it a try,
> but now I am getting this error:
>
>
> 06:18:30.599 [main] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
> Adding component XMLGenerator(hashCode=1538386262
> internalGenerator=URLGenerator(hashCode=782702191
> source=file:/home/mansour/workspace/sources/cocoon/cocoon-sax/target/test-classes/article.xml))
> to pipeline [CachingPipeline(hashCode=341284117 components=[])].
> 06:18:31.597 [main] DEBUG o.a.c.sax.component.XSLTTransformer -
> XSLTTransformer local cache miss:
> file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl
> Compiler warnings:
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
> line 610: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
> line 662: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
> line 662: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
> line 686: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
> line 686: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/lists.xsl:
> line 862: Attribute 'type' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/callout.xsl:
> line 116: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
> line 188: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
> line 1017: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
> line 211: Attribute 'id' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
> line 435: Attribute 'id' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/htmltbl.xsl:
> line 20: Attribute 'id' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 108: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 108: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 144: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 144: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 184: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 184: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 714: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 939: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1063: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1193: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1193: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1294: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
> line 1332: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 283: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 283: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 353: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
> line 353: Attribute 'href' outside of element.
>   file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
> line 117: Attribute 'onClick' outside of element.
> ERROR:  'Syntax error in '* or $generate.index != 0'.'
> FATAL ERROR:  'Could not compile stylesheet'
> javax.xml.transform.TransformerConfigurationException: Could not
> compile stylesheet
>         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
>         at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
>         at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
>         at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>
>
> On Thu, Nov 8, 2012 at 9:34 AM, Robby Pelssers <Ro...@nxp.com> wrote:
>> I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.
>>
>> Robby
>>
>> -----Original Message-----
>> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com]
>> Sent: Thursday, November 08, 2012 3:31 PM
>> To: users@cocoon.apache.org
>> Subject: Re: Unable to transform to docbook
>>
>> 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 <Ro...@nxp.com> wrote:
>>> 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 steps 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.newNonCachingPipeline
>>> ;
>>>
>>>
>>> public class XSLTIncludeTest extends TestCase  {
>>>
>>>     public void testTransformerWithInclude() throws Exception {
>>>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>>
>>>         newNonCachingPipeline()
>>>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>>>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>>>                 .addSerializer()
>>>                 .withEmptyConfiguration()
>>>                 .setup(baos)
>>>                 .execute();
>>>
>>>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>>>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>>>     }
>>>
>>> }
>>> **********************************food.xslt
>>> *********************************************
>>> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>>
>>>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>>>        to the included vegetables.xslt -->
>>>
>>>   <xsl:include href="vegetables.xslt"/>
>>>
>>>   <xsl:template match="/">
>>>     <xsl:apply-templates/>
>>>   </xsl:template>
>>>
>>>   <xsl:template match="food">
>>>     <ul>
>>>        <xsl:apply-templates/>
>>>     </ul>
>>>   </xsl:template>
>>>
>>>   <xsl:template match="fruit">
>>>     <li class="fruit"><xsl:apply-templates/></li>
>>>   </xsl:template>
>>>
>>> </xsl:stylesheet>
>>>
>>> ************************************vegetables.xslt*******************
>>> *************************** <?xml version="1.0" encoding="UTF-8"?>
>>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>> version="1.0">
>>>
>>>   <xsl:template match="vegetable">
>>>     <li class="vegetable"><xsl:apply-templates/></li>
>>>   </xsl:template>
>>>
>>> </xsl:stylesheet>
>>>
>>> **********************************************************************
>>> ************************
>>>
>>>
>>>
>>> -----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 planning 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/XSLTTransform
>>> er.java
>>>
>>>           try {
>>> 160                 this.templates =
>>> 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<Templates> cacheEntry = new
>>> ValidityValue<Templates>(this.templates, lastModified);
>>> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
>>> 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 resolver can not load the imported or included, xslts.
>>>
>>> The only way I know of, is to set the systemId so something like this should do the trick:
>>>
>>> StreamSource tmpSource = new
>>> StreamSource(this.source.toExternalForm());
>>> URL fullPath =  .....
>>> tmpSource.setSystemId(fullPath);
>>> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>>>> You know what...
>>>>>
>>>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>>>
>>>>> 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 <Ro...@nxp.com> wrote:
>>>>>> Hi Mansour,
>>>>>>
>>>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>>>
>>>>> 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 do:
>>>>>>
>>>>>> <map:match pattern="article/{id}">
>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>   <map:serialize />
>>>>>> </map:match>
>>>>>>
>>>>>> Also try to generate that xsl:
>>>>>>
>>>>>> <map:match pattern="transform/docbook.xsl">
>>>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>>>   <map:serialize />
>>>>>> </map:match>
>>>>>>
>>>>>> 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 the 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 <xsl:include> :
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>> xmlns:ng="http://docbook.org/docbook-ng"
>>>>> xmlns:db="http://docbook.org/ns/docbook"
>>>>> xmlns:exsl="http://exslt.org/common"
>>>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>>>> exsl exslt" version="1.0">
>>>>>
>>>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>>>
>>>>> <!-- ********************************************************************
>>>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>>>
>>>>> ********************************************************************
>>>>>
>>>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>>>      copyright and other information.
>>>>>
>>>>>
>>>>> ********************************************************************
>>>>> -->
>>>>>
>>>>> <!--
>>>>> ====================================================================
>>>>> -->
>>>>>
>>>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/>
>>>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include
>>>>> href="../common/l10n.xsl"/> <xsl:include
>>>>> href="../common/common.xsl"/> <xsl:include
>>>>> href="../common/utility.xsl"/> <xsl:include
>>>>> href="../common/labels.xsl"/> <xsl:include
>>>>> href="../common/titles.xsl"/> <xsl:include
>>>>> href="../common/subtitles.xsl"/>
>>>>>
>>>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>>>> href="../common/targets.xsl"/> <xsl:include
>>>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>>>> I need to generate HTML from docbook file.
>>>>>>
>>>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>>>> org.apache.cocoon.sitemap.InvocationException:
>>>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>         at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>>>> e
>>>>>> 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.execute(XMLGenerator.java:385)
>>>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>>>         ... 60 more
>>>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>>>         at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>>>> u
>>>>>> me
>>>>>> nt(AbstractSAXParser.java:742)
>>>>>>
>>>>>> ......
>>>>>>
>>>>>> Here's my pipeline:
>>>>>>
>>>>>>   <map:pipelines>
>>>>>>         <map:pipeline>
>>>>>>
>>>>>>             <map:match pattern="article/{id}">
>>>>>>                 <map:generate
>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>                 <map:transform
>>>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>>>> />
>>>>>>                 <map:serialize />
>>>>>>             </map:match>
>>>>>>
>>>>>>
>>>>>> This matcher is working with another transformation.
>>>>>> For example the following pipeline:
>>>>>>
>>>>>>         <map:pipeline>
>>>>>>
>>>>>>             <map:match pattern="article/{id}">
>>>>>>                 <map:generate
>>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>>>                 <map:serialize />
>>>>>>             </map:match>
>>>>>>
>>>>>> Would work fine.
>>>>>>
>>>>>> The same file "ex.xml" can be processed with xalan from the command line 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
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
Robby, here's the code I am using for my test case. Nothing fancy,
just to be able to debug loading the xslt:


	@Test
	public void docbookTest() throws Exception {
		Cache cache = new SimpleCache();

		CachingPipeline<SAXPipelineComponent> pipeline = new
CachingPipeline<SAXPipelineComponent>();
		pipeline.setCache(cache);

		pipeline.addComponent(new XMLGenerator(getClass().getResource(
				"/article.xml")));

		URL xsltURL = new
URL("file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl");

		XSLTTransformer xslt = new XSLTTransformer(xsltURL);

		pipeline.addComponent(xslt);

		pipeline.addComponent(XMLSerializer.createXMLSerializer());

		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		pipeline.setup(baos);
		pipeline.execute();

	}


here's the error I am getting:


  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 939: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1063: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1193: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1193: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1294: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1332: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 283: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 283: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 353: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 353: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
line 117: Attribute 'onClick' outside of element.
ERROR:  'Cannot find external method
'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
FATAL ERROR:  'Could not compile stylesheet'
javax.xml.transform.TransformerConfigurationException: Could not
compile stylesheet
	at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
	at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
	at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
	at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
	at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


I downgraded to xalan-2.7.0 in the parent/pom.xml to give it a try,
but now I am getting this error:


06:18:30.599 [main] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Adding component XMLGenerator(hashCode=1538386262
internalGenerator=URLGenerator(hashCode=782702191
source=file:/home/mansour/workspace/sources/cocoon/cocoon-sax/target/test-classes/article.xml))
to pipeline [CachingPipeline(hashCode=341284117 components=[])].
06:18:31.597 [main] DEBUG o.a.c.sax.component.XSLTTransformer -
XSLTTransformer local cache miss:
file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl
Compiler warnings:
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
line 610: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
line 662: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
line 662: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
line 686: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/autoidx.xsl:
line 686: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/lists.xsl:
line 862: Attribute 'type' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/callout.xsl:
line 116: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
line 188: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/xref.xsl:
line 1017: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
line 211: Attribute 'id' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/formal.xsl:
line 435: Attribute 'id' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/htmltbl.xsl:
line 20: Attribute 'id' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 108: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 108: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 144: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 144: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 184: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 184: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 714: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 939: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1063: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1193: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1193: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1294: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
line 1332: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 283: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 283: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 353: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
line 353: Attribute 'href' outside of element.
  file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
line 117: Attribute 'onClick' outside of element.
ERROR:  'Syntax error in '* or $generate.index != 0'.'
FATAL ERROR:  'Could not compile stylesheet'
javax.xml.transform.TransformerConfigurationException: Could not
compile stylesheet
	at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
	at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:164)
	at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:112)
	at org.apache.cocoon.sax.component.XSLTTransformer.<init>(XSLTTransformer.java:98)
	at org.apache.cocoon.sax.component.XSLTTransformerTest.docbookTest(XSLTTransformerTest.java:86)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



On Thu, Nov 8, 2012 at 9:34 AM, Robby Pelssers <Ro...@nxp.com> wrote:
> I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.
>
> Robby
>
> -----Original Message-----
> From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com]
> Sent: Thursday, November 08, 2012 3:31 PM
> To: users@cocoon.apache.org
> Subject: Re: Unable to transform to docbook
>
> 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 <Ro...@nxp.com> wrote:
>> 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 steps 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.newNonCachingPipeline
>> ;
>>
>>
>> public class XSLTIncludeTest extends TestCase  {
>>
>>     public void testTransformerWithInclude() throws Exception {
>>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>>
>>         newNonCachingPipeline()
>>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>>                 .addSerializer()
>>                 .withEmptyConfiguration()
>>                 .setup(baos)
>>                 .execute();
>>
>>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>>     }
>>
>> }
>> **********************************food.xslt
>> *********************************************
>> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>
>>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>>        to the included vegetables.xslt -->
>>
>>   <xsl:include href="vegetables.xslt"/>
>>
>>   <xsl:template match="/">
>>     <xsl:apply-templates/>
>>   </xsl:template>
>>
>>   <xsl:template match="food">
>>     <ul>
>>        <xsl:apply-templates/>
>>     </ul>
>>   </xsl:template>
>>
>>   <xsl:template match="fruit">
>>     <li class="fruit"><xsl:apply-templates/></li>
>>   </xsl:template>
>>
>> </xsl:stylesheet>
>>
>> ************************************vegetables.xslt*******************
>> *************************** <?xml version="1.0" encoding="UTF-8"?>
>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> version="1.0">
>>
>>   <xsl:template match="vegetable">
>>     <li class="vegetable"><xsl:apply-templates/></li>
>>   </xsl:template>
>>
>> </xsl:stylesheet>
>>
>> **********************************************************************
>> ************************
>>
>>
>>
>> -----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 planning 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/XSLTTransform
>> er.java
>>
>>           try {
>> 160                 this.templates =
>> 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<Templates> cacheEntry = new
>> ValidityValue<Templates>(this.templates, lastModified);
>> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
>> 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 resolver can not load the imported or included, xslts.
>>
>> The only way I know of, is to set the systemId so something like this should do the trick:
>>
>> StreamSource tmpSource = new
>> StreamSource(this.source.toExternalForm());
>> URL fullPath =  .....
>> tmpSource.setSystemId(fullPath);
>> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>>> You know what...
>>>>
>>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>>
>>>> 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 <Ro...@nxp.com> wrote:
>>>>> Hi Mansour,
>>>>>
>>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>>
>>>> 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 do:
>>>>>
>>>>> <map:match pattern="article/{id}">
>>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>   <map:serialize />
>>>>> </map:match>
>>>>>
>>>>> Also try to generate that xsl:
>>>>>
>>>>> <map:match pattern="transform/docbook.xsl">
>>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>>   <map:serialize />
>>>>> </map:match>
>>>>>
>>>>> 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 the 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 <xsl:include> :
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>> xmlns:ng="http://docbook.org/docbook-ng"
>>>> xmlns:db="http://docbook.org/ns/docbook"
>>>> xmlns:exsl="http://exslt.org/common"
>>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>>> exsl exslt" version="1.0">
>>>>
>>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>>
>>>> <!-- ********************************************************************
>>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>>
>>>> ********************************************************************
>>>>
>>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>>      copyright and other information.
>>>>
>>>>
>>>> ********************************************************************
>>>> -->
>>>>
>>>> <!--
>>>> ====================================================================
>>>> -->
>>>>
>>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/>
>>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include
>>>> href="../common/l10n.xsl"/> <xsl:include
>>>> href="../common/common.xsl"/> <xsl:include
>>>> href="../common/utility.xsl"/> <xsl:include
>>>> href="../common/labels.xsl"/> <xsl:include
>>>> href="../common/titles.xsl"/> <xsl:include
>>>> href="../common/subtitles.xsl"/>
>>>>
>>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>>> href="../common/targets.xsl"/> <xsl:include
>>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>>> I need to generate HTML from docbook file.
>>>>>
>>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>>> org.apache.cocoon.sitemap.InvocationException:
>>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>         at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>>> e
>>>>> 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.execute(XMLGenerator.java:385)
>>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>>         ... 60 more
>>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>>         at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>>> u
>>>>> me
>>>>> nt(AbstractSAXParser.java:742)
>>>>>
>>>>> ......
>>>>>
>>>>> Here's my pipeline:
>>>>>
>>>>>   <map:pipelines>
>>>>>         <map:pipeline>
>>>>>
>>>>>             <map:match pattern="article/{id}">
>>>>>                 <map:generate
>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>                 <map:transform
>>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>>> />
>>>>>                 <map:serialize />
>>>>>             </map:match>
>>>>>
>>>>>
>>>>> This matcher is working with another transformation.
>>>>> For example the following pipeline:
>>>>>
>>>>>         <map:pipeline>
>>>>>
>>>>>             <map:match pattern="article/{id}">
>>>>>                 <map:generate
>>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>>                 <map:serialize />
>>>>>             </map:match>
>>>>>
>>>>> Would work fine.
>>>>>
>>>>> The same file "ex.xml" can be processed with xalan from the command line 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
>
>
>
>
> ---------------------------------------------------------------------
> 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


RE: Unable to transform to docbook

Posted by Robby Pelssers <Ro...@nxp.com>.
I did see you created an issue. But if you could provide me a small isolated test case in some zip I could have taken a look at it. Still ready to help out.

Robby

-----Original Message-----
From: Mansour Al Akeel [mailto:mansour.alakeel@gmail.com] 
Sent: Thursday, November 08, 2012 3:31 PM
To: users@cocoon.apache.org
Subject: Re: Unable to transform to docbook

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 <Ro...@nxp.com> wrote:
> 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 steps 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.newNonCachingPipeline
> ;
>
>
> public class XSLTIncludeTest extends TestCase  {
>
>     public void testTransformerWithInclude() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>
>         newNonCachingPipeline()
>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>                 .addSerializer()
>                 .withEmptyConfiguration()
>                 .setup(baos)
>                 .execute();
>
>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>     }
>
> }
> **********************************food.xslt 
> *********************************************
> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>
>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>        to the included vegetables.xslt -->
>
>   <xsl:include href="vegetables.xslt"/>
>
>   <xsl:template match="/">
>     <xsl:apply-templates/>
>   </xsl:template>
>
>   <xsl:template match="food">
>     <ul>
>        <xsl:apply-templates/>
>     </ul>
>   </xsl:template>
>
>   <xsl:template match="fruit">
>     <li class="fruit"><xsl:apply-templates/></li>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> ************************************vegetables.xslt*******************
> *************************** <?xml version="1.0" encoding="UTF-8"?> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0">
>
>   <xsl:template match="vegetable">
>     <li class="vegetable"><xsl:apply-templates/></li>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> **********************************************************************
> ************************
>
>
>
> -----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 planning 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/XSLTTransform
> er.java
>
>           try {
> 160                 this.templates =
> 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<Templates> cacheEntry = new
> ValidityValue<Templates>(this.templates, lastModified);
> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
> 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 resolver can not load the imported or included, xslts.
>
> The only way I know of, is to set the systemId so something like this should do the trick:
>
> StreamSource tmpSource = new 
> StreamSource(this.source.toExternalForm());
> URL fullPath =  .....
> tmpSource.setSystemId(fullPath);
> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>> You know what...
>>>
>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>
>>> 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 <Ro...@nxp.com> wrote:
>>>> Hi Mansour,
>>>>
>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>
>>> 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 do:
>>>>
>>>> <map:match pattern="article/{id}">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> Also try to generate that xsl:
>>>>
>>>> <map:match pattern="transform/docbook.xsl">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> 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 the 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 <xsl:include> :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>> xmlns:ng="http://docbook.org/docbook-ng"
>>> xmlns:db="http://docbook.org/ns/docbook"
>>> xmlns:exsl="http://exslt.org/common"
>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng 
>>> exsl exslt" version="1.0">
>>>
>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>
>>> <!-- ********************************************************************
>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>
>>> ********************************************************************
>>>
>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>      copyright and other information.
>>>
>>>
>>> ********************************************************************
>>> -->
>>>
>>> <!--
>>> ====================================================================
>>> -->
>>>
>>> <xsl:include href="../VERSION.xsl"/> <xsl:include href="param.xsl"/> 
>>> <xsl:include href="../lib/lib.xsl"/> <xsl:include 
>>> href="../common/l10n.xsl"/> <xsl:include 
>>> href="../common/common.xsl"/> <xsl:include 
>>> href="../common/utility.xsl"/> <xsl:include 
>>> href="../common/labels.xsl"/> <xsl:include 
>>> href="../common/titles.xsl"/> <xsl:include 
>>> href="../common/subtitles.xsl"/>
>>>
>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include 
>>> href="../common/targets.xsl"/> <xsl:include 
>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> 
>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>> I need to generate HTML from docbook file.
>>>>
>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>> org.apache.cocoon.sitemap.InvocationException:
>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>         at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
>>>> e
>>>> 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.execute(XMLGenerator.java:385)
>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>         ... 60 more
>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>         at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDoc
>>>> u
>>>> me
>>>> nt(AbstractSAXParser.java:742)
>>>>
>>>> ......
>>>>
>>>> Here's my pipeline:
>>>>
>>>>   <map:pipelines>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform
>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>> />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>>
>>>> This matcher is working with another transformation.
>>>> For example the following pipeline:
>>>>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>> Would work fine.
>>>>
>>>> The same file "ex.xml" can be processed with xalan from the command line 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




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
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 <Ro...@nxp.com> wrote:
> 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 steps 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.newNonCachingPipeline;
>
>
> public class XSLTIncludeTest extends TestCase  {
>
>     public void testTransformerWithInclude() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>
>         newNonCachingPipeline()
>                 .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
>                 .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
>                 .addSerializer()
>                 .withEmptyConfiguration()
>                 .setup(baos)
>                 .execute();
>
>         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
>         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
>     }
>
> }
> **********************************food.xslt *********************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>
>   <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
>        to the included vegetables.xslt -->
>
>   <xsl:include href="vegetables.xslt"/>
>
>   <xsl:template match="/">
>     <xsl:apply-templates/>
>   </xsl:template>
>
>   <xsl:template match="food">
>     <ul>
>        <xsl:apply-templates/>
>     </ul>
>   </xsl:template>
>
>   <xsl:template match="fruit">
>     <li class="fruit"><xsl:apply-templates/></li>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> ************************************vegetables.xslt**********************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>
>   <xsl:template match="vegetable">
>     <li class="vegetable"><xsl:apply-templates/></li>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> **********************************************************************************************
>
>
>
> -----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 planning 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/XSLTTransformer.java
>
>           try {
> 160                 this.templates =
> 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<Templates> cacheEntry = new
> ValidityValue<Templates>(this.templates, lastModified);
> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
> 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 resolver can not load the imported or included, xslts.
>
> The only way I know of, is to set the systemId so something like this should do the trick:
>
> StreamSource tmpSource = new StreamSource(this.source.toExternalForm());
> URL fullPath =  .....
> tmpSource.setSystemId(fullPath);
> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>> You know what...
>>>
>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>
>>> 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 <Ro...@nxp.com> wrote:
>>>> Hi Mansour,
>>>>
>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>>
>>> 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 do:
>>>>
>>>> <map:match pattern="article/{id}">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> Also try to generate that xsl:
>>>>
>>>> <map:match pattern="transform/docbook.xsl">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> 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 the 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 <xsl:include> :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>> xmlns:ng="http://docbook.org/docbook-ng"
>>> xmlns:db="http://docbook.org/ns/docbook"
>>> xmlns:exsl="http://exslt.org/common"
>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
>>> exsl exslt" version="1.0">
>>>
>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>
>>> <!-- ********************************************************************
>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>
>>> ********************************************************************
>>>
>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>      copyright and other information.
>>>
>>>
>>> ********************************************************************
>>> -->
>>>
>>> <!--
>>> ====================================================================
>>> -->
>>>
>>> <xsl:include href="../VERSION.xsl"/>
>>> <xsl:include href="param.xsl"/>
>>> <xsl:include href="../lib/lib.xsl"/>
>>> <xsl:include href="../common/l10n.xsl"/> <xsl:include
>>> href="../common/common.xsl"/> <xsl:include
>>> href="../common/utility.xsl"/> <xsl:include
>>> href="../common/labels.xsl"/> <xsl:include
>>> href="../common/titles.xsl"/> <xsl:include
>>> href="../common/subtitles.xsl"/>
>>>
>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include
>>> href="../common/targets.xsl"/> <xsl:include
>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/>
>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>> I need to generate HTML from docbook file.
>>>>
>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>> org.apache.cocoon.sitemap.InvocationException:
>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.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.execute(XMLGenerator.java:385)
>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>         ... 60 more
>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>         at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocu
>>>> me
>>>> nt(AbstractSAXParser.java:742)
>>>>
>>>> ......
>>>>
>>>> Here's my pipeline:
>>>>
>>>>   <map:pipelines>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform
>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>> />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>>
>>>> This matcher is working with another transformation.
>>>> For example the following pipeline:
>>>>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>> Would work fine.
>>>>
>>>> The same file "ex.xml" can be processed with xalan from the command line 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


RE: Unable to transform to docbook

Posted by Robby Pelssers <Ro...@nxp.com>.
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 steps 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.newNonCachingPipeline;


public class XSLTIncludeTest extends TestCase  {

    public void testTransformerWithInclude() throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        newNonCachingPipeline()
                .setStringGenerator("<food><fruit>apple</fruit><vegetable>tomato</vegetable></food>")
                .addXSLTTransformer(this.getClass().getResource("/food.xslt"))
                .addSerializer()
                .withEmptyConfiguration()
                .setup(baos)
                .execute();

        Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ul><li class=\"fruit\">apple</li><li class=\"vegetable\">tomato</li></ul>", new String(baos.toByteArray()));
        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
    }

}
**********************************food.xslt *********************************************
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <!-- we will process the <fruit> tags in this stylesheet but leave the processing of <vegetable> tags
       to the included vegetables.xslt -->

  <xsl:include href="vegetables.xslt"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="food">
    <ul>
       <xsl:apply-templates/>
    </ul>
  </xsl:template>

  <xsl:template match="fruit">
    <li class="fruit"><xsl:apply-templates/></li>
  </xsl:template>

</xsl:stylesheet>

************************************vegetables.xslt**********************************************
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="vegetable">
    <li class="vegetable"><xsl:apply-templates/></li>
  </xsl:template>

</xsl:stylesheet>

**********************************************************************************************



-----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 planning 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/XSLTTransformer.java

          try {
160                 this.templates =
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<Templates> cacheEntry = new
ValidityValue<Templates>(this.templates, lastModified);
166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
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 resolver can not load the imported or included, xslts.

The only way I know of, is to set the systemId so something like this should do the trick:

StreamSource tmpSource = new StreamSource(this.source.toExternalForm());
URL fullPath =  .....
tmpSource.setSystemId(fullPath);
this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>> You know what...
>>
>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>
>> 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 <Ro...@nxp.com> wrote:
>>> Hi Mansour,
>>>
>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>
>> 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 do:
>>>
>>> <map:match pattern="article/{id}">
>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> Also try to generate that xsl:
>>>
>>> <map:match pattern="transform/docbook.xsl">
>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> 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 the 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 <xsl:include> :
>>
>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns:ng="http://docbook.org/docbook-ng"
>> xmlns:db="http://docbook.org/ns/docbook"
>> xmlns:exsl="http://exslt.org/common"
>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng 
>> exsl exslt" version="1.0">
>>
>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>
>> <!-- ********************************************************************
>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>      
>> ********************************************************************
>>
>>      This file is part of the XSL DocBook Stylesheet distribution.
>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>      copyright and other information.
>>
>>      
>> ********************************************************************
>> -->
>>
>> <!--
>> ====================================================================
>> -->
>>
>> <xsl:include href="../VERSION.xsl"/>
>> <xsl:include href="param.xsl"/>
>> <xsl:include href="../lib/lib.xsl"/>
>> <xsl:include href="../common/l10n.xsl"/> <xsl:include 
>> href="../common/common.xsl"/> <xsl:include 
>> href="../common/utility.xsl"/> <xsl:include 
>> href="../common/labels.xsl"/> <xsl:include 
>> href="../common/titles.xsl"/> <xsl:include 
>> href="../common/subtitles.xsl"/>
>>
>> <xsl:include href="../common/gentext.xsl"/> <xsl:include 
>> href="../common/targets.xsl"/> <xsl:include 
>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> 
>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>> I need to generate HTML from docbook file.
>>>
>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>> org.apache.cocoon.sitemap.InvocationException:
>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.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.execute(XMLGenerator.java:385)
>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>         ... 60 more
>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>         at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocu
>>> me
>>> nt(AbstractSAXParser.java:742)
>>>
>>> ......
>>>
>>> Here's my pipeline:
>>>
>>>   <map:pipelines>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform
>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>> />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>>
>>> This matcher is working with another transformation.
>>> For example the following pipeline:
>>>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>> Would work fine.
>>>
>>> The same file "ex.xml" can be processed with xalan from the command line 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


Re: Unable to transform to docbook

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 08/11/2012 09:30, Robby Pelssers wrote:
> 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 planning to do. 
>
> Too bad you can't send me a very simplistic project showing the problem.

Hi all,
sorry for jumping in only now; don't know the details of the problem,
but I have a simple example of working XSLT import in Cocoon 3 [1]: we
use this normally in production for our Cocoon 3-based frontend engine
for Hippo CMS.

Does it help?

Regards.

[1]
https://github.com/Tirasa/HippoCocoonToolkit/blob/hct-baby-steps/hctsite/src/main/resources/COB-INF/components/collection.xsl

> -----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/XSLTTransformer.java
>
>           try {
> 160                 this.templates =
> 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<Templates> cacheEntry = new
> ValidityValue<Templates>(this.templates, lastModified);
> 166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
> 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 resolver can not load the imported or included, xslts.
>
> The only way I know of, is to set the systemId so something like this should do the trick:
>
> StreamSource tmpSource = new StreamSource(this.source.toExternalForm());
> URL fullPath =  .....
> tmpSource.setSystemId(fullPath);
> this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>>> You know what...
>>>
>>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>>
>>> 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 <Ro...@nxp.com> wrote:
>>>> Hi Mansour,
>>>>
>>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>> 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 do:
>>>>
>>>> <map:match pattern="article/{id}">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> Also try to generate that xsl:
>>>>
>>>> <map:match pattern="transform/docbook.xsl">
>>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>>   <map:serialize />
>>>> </map:match>
>>>>
>>>> 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 the 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 <xsl:include> :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>> xmlns:ng="http://docbook.org/docbook-ng"
>>> xmlns:db="http://docbook.org/ns/docbook"
>>> xmlns:exsl="http://exslt.org/common"
>>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng 
>>> exsl exslt" version="1.0">
>>>
>>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>>
>>> <!-- ********************************************************************
>>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>>      
>>> ********************************************************************
>>>
>>>      This file is part of the XSL DocBook Stylesheet distribution.
>>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>>      copyright and other information.
>>>
>>>      
>>> ******************************************************************** 
>>> -->
>>>
>>> <!-- 
>>> ==================================================================== 
>>> -->
>>>
>>> <xsl:include href="../VERSION.xsl"/>
>>> <xsl:include href="param.xsl"/>
>>> <xsl:include href="../lib/lib.xsl"/>
>>> <xsl:include href="../common/l10n.xsl"/> <xsl:include 
>>> href="../common/common.xsl"/> <xsl:include 
>>> href="../common/utility.xsl"/> <xsl:include 
>>> href="../common/labels.xsl"/> <xsl:include 
>>> href="../common/titles.xsl"/> <xsl:include 
>>> href="../common/subtitles.xsl"/>
>>>
>>> <xsl:include href="../common/gentext.xsl"/> <xsl:include 
>>> href="../common/targets.xsl"/> <xsl:include 
>>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> 
>>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>>> I need to generate HTML from docbook file.
>>>>
>>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>>> org.apache.cocoon.sitemap.InvocationException:
>>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.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.execute(XMLGenerator.java:385)
>>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>>         ... 60 more
>>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>>         at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocu
>>>> me
>>>> nt(AbstractSAXParser.java:742)
>>>>
>>>> ......
>>>>
>>>> Here's my pipeline:
>>>>
>>>>   <map:pipelines>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform
>>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>>> />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>>
>>>> This matcher is working with another transformation.
>>>> For example the following pipeline:
>>>>
>>>>         <map:pipeline>
>>>>
>>>>             <map:match pattern="article/{id}">
>>>>                 <map:generate
>>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>>                 <map:serialize />
>>>>             </map:match>
>>>>
>>>> Would work fine.
>>>>
>>>> The same file "ex.xml" can be processed with xalan from the command line and produce the correct output !
>>>>
>>>> any idea ??

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Unable to transform to docbook

Posted by Robby Pelssers <Ro...@nxp.com>.
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 planning 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/XSLTTransformer.java

          try {
160                 this.templates =
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<Templates> cacheEntry = new
ValidityValue<Templates>(this.templates, lastModified);
166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
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 resolver can not load the imported or included, xslts.

The only way I know of, is to set the systemId so something like this should do the trick:

StreamSource tmpSource = new StreamSource(this.source.toExternalForm());
URL fullPath =  .....
tmpSource.setSystemId(fullPath);
this.templates = 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 <ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>> You know what...
>>
>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>
>> 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 <Ro...@nxp.com> wrote:
>>> Hi Mansour,
>>>
>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>
>> 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 do:
>>>
>>> <map:match pattern="article/{id}">
>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> Also try to generate that xsl:
>>>
>>> <map:match pattern="transform/docbook.xsl">
>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> 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 the 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 <xsl:include> :
>>
>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns:ng="http://docbook.org/docbook-ng"
>> xmlns:db="http://docbook.org/ns/docbook"
>> xmlns:exsl="http://exslt.org/common"
>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng 
>> exsl exslt" version="1.0">
>>
>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>
>> <!-- ********************************************************************
>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>      
>> ********************************************************************
>>
>>      This file is part of the XSL DocBook Stylesheet distribution.
>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>      copyright and other information.
>>
>>      
>> ******************************************************************** 
>> -->
>>
>> <!-- 
>> ==================================================================== 
>> -->
>>
>> <xsl:include href="../VERSION.xsl"/>
>> <xsl:include href="param.xsl"/>
>> <xsl:include href="../lib/lib.xsl"/>
>> <xsl:include href="../common/l10n.xsl"/> <xsl:include 
>> href="../common/common.xsl"/> <xsl:include 
>> href="../common/utility.xsl"/> <xsl:include 
>> href="../common/labels.xsl"/> <xsl:include 
>> href="../common/titles.xsl"/> <xsl:include 
>> href="../common/subtitles.xsl"/>
>>
>> <xsl:include href="../common/gentext.xsl"/> <xsl:include 
>> href="../common/targets.xsl"/> <xsl:include 
>> href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> 
>> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>> I need to generate HTML from docbook file.
>>>
>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>> org.apache.cocoon.sitemap.InvocationException:
>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.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.execute(XMLGenerator.java:385)
>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>         ... 60 more
>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>         at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocu
>>> me
>>> nt(AbstractSAXParser.java:742)
>>>
>>> ......
>>>
>>> Here's my pipeline:
>>>
>>>   <map:pipelines>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform
>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>> />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>>
>>> This matcher is working with another transformation.
>>> For example the following pipeline:
>>>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>> Would work fine.
>>>
>>> The same file "ex.xml" can be processed with xalan from the command line 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
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/XSLTTransformer.java

          try {
160                 this.templates =
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<Templates> cacheEntry = new
ValidityValue<Templates>(this.templates, lastModified);
166                 XSLT_CACHE.put(this.source.toExternalForm(), cacheEntry);
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 resolver can not load the imported or included, xslts.

The only way I know of, is to set the systemId so something like this
should do the trick:

StreamSource tmpSource = new StreamSource(this.source.toExternalForm());
URL fullPath =  .....
tmpSource.setSystemId(fullPath);
this.templates = 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
<ma...@gmail.com> 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 <Ro...@nxp.com> wrote:
>> You know what...
>>
>> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>>
>> 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 <Ro...@nxp.com> wrote:
>>> Hi Mansour,
>>>
>>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>>
>> 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 do:
>>>
>>> <map:match pattern="article/{id}">
>>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> Also try to generate that xsl:
>>>
>>> <map:match pattern="transform/docbook.xsl">
>>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>>   <map:serialize />
>>> </map:match>
>>>
>>> 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 the 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 <xsl:include> :
>>
>> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns:ng="http://docbook.org/docbook-ng"
>> xmlns:db="http://docbook.org/ns/docbook"
>> xmlns:exsl="http://exslt.org/common"
>> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng exsl exslt" version="1.0">
>>
>> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>>
>> <!-- ********************************************************************
>>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>>      ********************************************************************
>>
>>      This file is part of the XSL DocBook Stylesheet distribution.
>>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>>      copyright and other information.
>>
>>      ******************************************************************** -->
>>
>> <!-- ==================================================================== -->
>>
>> <xsl:include href="../VERSION.xsl"/>
>> <xsl:include href="param.xsl"/>
>> <xsl:include href="../lib/lib.xsl"/>
>> <xsl:include href="../common/l10n.xsl"/> <xsl:include href="../common/common.xsl"/> <xsl:include href="../common/utility.xsl"/> <xsl:include href="../common/labels.xsl"/> <xsl:include href="../common/titles.xsl"/> <xsl:include href="../common/subtitles.xsl"/>
>>
>> <xsl:include href="../common/gentext.xsl"/> <xsl:include href="../common/targets.xsl"/> <xsl:include href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>>> I need to generate HTML from docbook file.
>>>
>>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>>> org.apache.cocoon.sitemap.InvocationException:
>>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>>> 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.execute(XMLGenerator.java:385)
>>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>>         ... 60 more
>>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>>         at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocume
>>> nt(AbstractSAXParser.java:742)
>>>
>>> ......
>>>
>>> Here's my pipeline:
>>>
>>>   <map:pipelines>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform
>>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>>> />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>>
>>> This matcher is working with another transformation.
>>> For example the following pipeline:
>>>
>>>         <map:pipeline>
>>>
>>>             <map:match pattern="article/{id}">
>>>                 <map:generate
>>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>>                 <map:serialize />
>>>             </map:match>
>>>
>>> Would work fine.
>>>
>>> The same file "ex.xml" can be processed with xalan from the command line 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
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 <Ro...@nxp.com> wrote:
> You know what...
>
> It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.
>
> 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 <Ro...@nxp.com> wrote:
>> Hi Mansour,
>>
>> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.
>
> 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 do:
>>
>> <map:match pattern="article/{id}">
>>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>   <map:serialize />
>> </map:match>
>>
>> Also try to generate that xsl:
>>
>> <map:match pattern="transform/docbook.xsl">
>>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>>   <map:serialize />
>> </map:match>
>>
>> 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 the 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 <xsl:include> :
>
> <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:ng="http://docbook.org/docbook-ng"
> xmlns:db="http://docbook.org/ns/docbook"
> xmlns:exsl="http://exslt.org/common"
> xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng exsl exslt" version="1.0">
>
> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
>
> <!-- ********************************************************************
>      $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
>      ********************************************************************
>
>      This file is part of the XSL DocBook Stylesheet distribution.
>      See ../README or http://docbook.sf.net/release/xsl/current/ for
>      copyright and other information.
>
>      ******************************************************************** -->
>
> <!-- ==================================================================== -->
>
> <xsl:include href="../VERSION.xsl"/>
> <xsl:include href="param.xsl"/>
> <xsl:include href="../lib/lib.xsl"/>
> <xsl:include href="../common/l10n.xsl"/> <xsl:include href="../common/common.xsl"/> <xsl:include href="../common/utility.xsl"/> <xsl:include href="../common/labels.xsl"/> <xsl:include href="../common/titles.xsl"/> <xsl:include href="../common/subtitles.xsl"/>
>
> <xsl:include href="../common/gentext.xsl"/> <xsl:include href="../common/targets.xsl"/> <xsl:include href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
>> I need to generate HTML from docbook file.
>>
>> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
>> ERROR XMLSitemapServlet - Cocoon can't process the request.
>> org.apache.cocoon.sitemap.InvocationException:
>> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> 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.execute(XMLGenerator.java:385)
>>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>>         ... 60 more
>> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
>> javax.xml.transform.TransformerException: java.lang.NullPointerException
>>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>>         at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocume
>> nt(AbstractSAXParser.java:742)
>>
>> ......
>>
>> Here's my pipeline:
>>
>>   <map:pipelines>
>>         <map:pipeline>
>>
>>             <map:match pattern="article/{id}">
>>                 <map:generate
>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>                 <map:transform
>> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
>> />
>>                 <map:serialize />
>>             </map:match>
>>
>>
>> This matcher is working with another transformation.
>> For example the following pipeline:
>>
>>         <map:pipeline>
>>
>>             <map:match pattern="article/{id}">
>>                 <map:generate
>> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>>                 <map:transform src="sheets/myCustomSheet.xsl" />
>>                 <map:serialize />
>>             </map:match>
>>
>> Would work fine.
>>
>> The same file "ex.xml" can be processed with xalan from the command line 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


RE: Unable to transform to docbook

Posted by Robby Pelssers <Ro...@nxp.com>.
You know what... 

It might be a problem with the includes but to be honest I would have expected 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 situation 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 issue.

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 <Ro...@nxp.com> wrote:
> Hi Mansour,
>
> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.

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 do:
>
> <map:match pattern="article/{id}">
>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>   <map:serialize />
> </map:match>
>
> Also try to generate that xsl:
>
> <map:match pattern="transform/docbook.xsl">
>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>   <map:serialize />
> </map:match>
>
> 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 the 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 <xsl:include> :

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:exsl="http://exslt.org/common"
xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng exsl exslt" version="1.0">

<xsl:output method="html" encoding="ISO-8859-1" indent="no"/>

<!-- ********************************************************************
     $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
     ********************************************************************

     This file is part of the XSL DocBook Stylesheet distribution.
     See ../README or http://docbook.sf.net/release/xsl/current/ for
     copyright and other information.

     ******************************************************************** -->

<!-- ==================================================================== -->

<xsl:include href="../VERSION.xsl"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/> <xsl:include href="../common/common.xsl"/> <xsl:include href="../common/utility.xsl"/> <xsl:include href="../common/labels.xsl"/> <xsl:include href="../common/titles.xsl"/> <xsl:include href="../common/subtitles.xsl"/>

<xsl:include href="../common/gentext.xsl"/> <xsl:include href="../common/targets.xsl"/> <xsl:include href="../common/olink.xsl"/> <xsl:include href="../common/pi.xsl"/> <xsl:include href="autotoc.xsl"/> <xsl:include href="autoidx.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 for a coming project.
> I need to generate HTML from docbook file.
>
> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
> ERROR XMLSitemapServlet - Cocoon can't process the request.
> org.apache.cocoon.sitemap.InvocationException:
> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> 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.execute(XMLGenerator.java:385)
>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>         ... 60 more
> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
> javax.xml.transform.TransformerException: java.lang.NullPointerException
>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>         at 
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocume
> nt(AbstractSAXParser.java:742)
>
> ......
>
> Here's my pipeline:
>
>   <map:pipelines>
>         <map:pipeline>
>
>             <map:match pattern="article/{id}">
>                 <map:generate
> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>                 <map:transform
> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
> />
>                 <map:serialize />
>             </map:match>
>
>
> This matcher is working with another transformation.
> For example the following pipeline:
>
>         <map:pipeline>
>
>             <map:match pattern="article/{id}">
>                 <map:generate
> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>                 <map:transform src="sheets/myCustomSheet.xsl" />
>                 <map:serialize />
>             </map:match>
>
> Would work fine.
>
> The same file "ex.xml" can be processed with xalan from the command line 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


Re: Unable to transform to docbook

Posted by Mansour Al Akeel <ma...@gmail.com>.
On Mon, Nov 5, 2012 at 7:51 AM, Robby Pelssers <Ro...@nxp.com> wrote:
> Hi Mansour,
>
> First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.

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 do:
>
> <map:match pattern="article/{id}">
>   <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>   <map:serialize />
> </map:match>
>
> Also try to generate that xsl:
>
> <map:match pattern="transform/docbook.xsl">
>   <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
>   <map:serialize />
> </map:match>
>
> 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 the 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 <xsl:include> :

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:exsl="http://exslt.org/common"
xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="db ng
exsl exslt" version="1.0">

<xsl:output method="html" encoding="ISO-8859-1" indent="no"/>

<!-- ********************************************************************
     $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
     ********************************************************************

     This file is part of the XSL DocBook Stylesheet distribution.
     See ../README or http://docbook.sf.net/release/xsl/current/ for
     copyright and other information.

     ******************************************************************** -->

<!-- ==================================================================== -->

<xsl:include href="../VERSION.xsl"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/>
<xsl:include href="../common/common.xsl"/>
<xsl:include href="../common/utility.xsl"/>
<xsl:include href="../common/labels.xsl"/>
<xsl:include href="../common/titles.xsl"/>
<xsl:include href="../common/subtitles.xsl"/>

<xsl:include href="../common/gentext.xsl"/>
<xsl:include href="../common/targets.xsl"/>
<xsl:include href="../common/olink.xsl"/>
<xsl:include href="../common/pi.xsl"/>
<xsl:include href="autotoc.xsl"/>
<xsl:include href="autoidx.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 for a coming project.
> I need to generate HTML from docbook file.
>
> INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
> ERROR XMLSitemapServlet - Cocoon can't process the request.
> org.apache.cocoon.sitemap.InvocationException:
> org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
>         at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
>         at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>         at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>         at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
>         at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>         at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
>         at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
>         at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
>         at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.execute(XMLGenerator.java:385)
>         at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
>         at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
>         at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>         at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>         at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>         at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>         at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
>         at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
>         ... 60 more
> Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
> javax.xml.transform.TransformerException: java.lang.NullPointerException
>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
>         at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
>         at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:742)
>
> ......
>
> Here's my pipeline:
>
>   <map:pipelines>
>         <map:pipeline>
>
>             <map:match pattern="article/{id}">
>                 <map:generate
> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>                 <map:transform
> src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
> />
>                 <map:serialize />
>             </map:match>
>
>
> This matcher is working with another transformation.
> For example the following pipeline:
>
>         <map:pipeline>
>
>             <map:match pattern="article/{id}">
>                 <map:generate
> src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
>                 <map:transform src="sheets/myCustomSheet.xsl" />
>                 <map:serialize />
>             </map:match>
>
> Would work fine.
>
> The same file "ex.xml" can be processed with xalan from the command line 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


RE: Unable to transform to docbook

Posted by Robby Pelssers <Ro...@nxp.com>.
Hi Mansour,

First of all I assume you don't have the same match patterns in the same sitemap..right? I guess you altered the implementation just to test and the first one (docbook.xsl) failed and the second one (myCustomSheet.xsl) worked.

The most obvious way to debug is to try what following matchers will do:

<map:match pattern="article/{id}">
  <map:generate src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
  <map:serialize />
</map:match>

Also try to generate that xsl:

<map:match pattern="transform/docbook.xsl">
  <map:generate src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl " />
  <map:serialize />
</map:match>

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 the docbookx.xsl has imports/includes or if it has declared xsl parameters.

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 for a coming project.
I need to generate HTML from docbook file.

INFO  RequestProcessor - Sitemap execution for /article/ex took 6470.727 ms.
ERROR XMLSitemapServlet - Cocoon can't process the request.
org.apache.cocoon.sitemap.InvocationException:
org.apache.cocoon.pipeline.ProcessingException: Can't parse url connection file:/home/mansour/workspace/pipelines/repo/articles/ex.xml
        at org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
        at org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:101)
        at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:71)
        at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
        at org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
        at org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:96)
        at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
        at org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:233)
        at org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:290)
        at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:90)
        at org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:47)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.execute(XMLGenerator.java:385)
        at org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:104)
        at org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:146)
        at org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:143)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.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(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.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(InvocationImpl.java:141)
        at org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:66)
        ... 60 more
Caused by: org.xml.sax.SAXException: java.lang.NullPointerException
javax.xml.transform.TransformerException: java.lang.NullPointerException
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:245)
        at org.apache.cocoon.xml.sax.AbstractSAXPipe.endDocument(AbstractSAXPipe.java:58)
        at org.apache.cocoon.sax.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:47)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:742)

......

Here's my pipeline:

  <map:pipelines>
        <map:pipeline>

            <map:match pattern="article/{id}">
                <map:generate
src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
                <map:transform
src="/home/mansour/workspace/pipelines/docbook-xsl-snapshot/html/docbook.xsl"
/>
                <map:serialize />
            </map:match>


This matcher is working with another transformation.
For example the following pipeline:

        <map:pipeline>

            <map:match pattern="article/{id}">
                <map:generate
src="/home/mansour/workspace/pipelines/repo/articles/{map:id}.xml" />
                <map:transform src="sheets/myCustomSheet.xsl" />
                <map:serialize />
            </map:match>

Would work fine.

The same file "ex.xml" can be processed with xalan from the command line 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