<xsl:include ... > - how to make it work!

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

<xsl:include ... > - how to make it work!

Stephen Bayliss

When running an XSL transform from oxf:xslt, it keeps falling over with a null pointer exception whenever it hits an <xsl:include .. > statement.

 

The included file is in the same directory as the original XSLT.  I’ve tried using no path, full directory path, oxf: style path, but nothing seems to work!

 

Has anyone successfully run an oxf:xslt pipeline process where the stylesheet is in a file, and uses <xsl:include … > to href another file?

 

Steve



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: <xsl:include ... > - how to make it work!

Erik Bruchez
Administrator
Steve,

There are several uses of xsl:include in OPS itself, in particular
theme.xsl includes formatting.xsl. This ought to work. You are not
generating the initial stylesheet dynamically, right?

Exactly how did you write your xsl:include statement, and then what
exactly does the stack trace show? Do you have the same behavior with
xsl:import?

-Erik

Stephen Bayliss wrote:

> When running an XSL transform from oxf:xslt, it keeps falling over with
> a null pointer exception whenever it hits an <xsl:include .. > statement.
>
>  
>
> The included file is in the same directory as the original XSLT.  I?ve
> tried using no path, full directory path, oxf: style path, but nothing
> seems to work!
>
>  
>
> Has anyone successfully run an oxf:xslt pipeline process where the
> stylesheet is in a file, and uses <xsl:include ? > to href another file?
>
>  
>
> Steve


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: <xsl:include ... > - how to make it work!

Stephen Bayliss
In reply to this post by Stephen Bayliss
Erik

Actually, the stylesheet input was being dynamically generated, but was
doing the include in this way <xsl:include href="oxf:/test/file.xsl"/>
so I still expected it to work.

However on knocking up a few example test cases, retrieving the
stylesheet as:
- href in an identity processor
- url-generator used to retrieve stylesheet
- oxf:xslt retrieving it with a <xsl:copy-of
select="doc('/test/file.xsl')/."/>

Only the third one does not work (whatever syntax I use for the href in
the xsl:include, oxf or not, path or not).

As it happens I can rewrite my original processor to avoid this dynamic
generation, so it looks like it will be ok.


-----Original Message-----
From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
Sent: 18 October 2005 13:35
To: [hidden email]
Subject: Re: [ops-users] <xsl:include ... > - how to make it work!

Steve,

There are several uses of xsl:include in OPS itself, in particular
theme.xsl includes formatting.xsl. This ought to work. You are not
generating the initial stylesheet dynamically, right?

Exactly how did you write your xsl:include statement, and then what
exactly does the stack trace show? Do you have the same behavior with
xsl:import?

-Erik

Stephen Bayliss wrote:
> When running an XSL transform from oxf:xslt, it keeps falling over
with
> a null pointer exception whenever it hits an <xsl:include .. >
statement.
>
>  
>
> The included file is in the same directory as the original XSLT.  I've

> tried using no path, full directory path, oxf: style path, but nothing

> seems to work!
>
>  
>
> Has anyone successfully run an oxf:xslt pipeline process where the
> stylesheet is in a file, and uses <xsl:include ... > to href another
file?
>
>  
>
> Steve





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: <xsl:include ... > - how to make it work!

Erik Bruchez
Administrator
Stephen,

Glad you have a workaround. It would still be good to have a stack trace
and/or a reproduceable case, se we can fix the bug.

-Erik

Stephen Bayliss wrote:

> Erik
>
> Actually, the stylesheet input was being dynamically generated, but was
> doing the include in this way <xsl:include href="oxf:/test/file.xsl"/>
> so I still expected it to work.
>
> However on knocking up a few example test cases, retrieving the
> stylesheet as:
> - href in an identity processor
> - url-generator used to retrieve stylesheet
> - oxf:xslt retrieving it with a <xsl:copy-of
> select="doc('/test/file.xsl')/."/>
>
> Only the third one does not work (whatever syntax I use for the href in
> the xsl:include, oxf or not, path or not).
>
> As it happens I can rewrite my original processor to avoid this dynamic
> generation, so it looks like it will be ok.
>
>
> -----Original Message-----
> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
> Sent: 18 October 2005 13:35
> To: [hidden email]
> Subject: Re: [ops-users] <xsl:include ... > - how to make it work!
>
> Steve,
>
> There are several uses of xsl:include in OPS itself, in particular
> theme.xsl includes formatting.xsl. This ought to work. You are not
> generating the initial stylesheet dynamically, right?
>
> Exactly how did you write your xsl:include statement, and then what
> exactly does the stack trace show? Do you have the same behavior with
> xsl:import?
>
> -Erik
>
> Stephen Bayliss wrote:
>
>>When running an XSL transform from oxf:xslt, it keeps falling over
>
> with
>
>>a null pointer exception whenever it hits an <xsl:include .. >
>
> statement.
>
>>
>>
>>The included file is in the same directory as the original XSLT.  I've
>
>
>>tried using no path, full directory path, oxf: style path, but nothing
>
>
>>seems to work!
>>
>>
>>
>>Has anyone successfully run an oxf:xslt pipeline process where the
>>stylesheet is in a file, and uses <xsl:include ... > to href another
>
> file?
>
>>
>>
>>Steve
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: <xsl:include ... > - how to make it work!

Stephen Bayliss
In reply to this post by Stephen Bayliss
Erik

Zip files of a reproducible example are attached.

Page flow is not in the zip, it is:
-------
    <page id="include-test" path-info="/include-test" view="/test1/try-include.xpl"/>
-------

Stack trace pasted below.

Note that the xpl included has 3 methods of accessing the style sheet before passing it to the oxf:xslt.  These are
- href the file directly using an identity processor
- grab the file with a url generator
- read the file using some xsl in an oxf:xslt.  

The one left uncommented at the moment is the xsl method, that's the one that causes the error.

Steve

===========
Stack trace
===========
Time: 15:51:52
Priority: ERROR
Thread: http-667-Processor25  
NDC: null
Category: org.orbeon.oxf.pipeline.InitUtils
Location: null
Message:
Exception at oxf:/test1/try-include.xpl, line 45, column 43, description reading processor output
Throwable:
java.lang.NullPointerException
        at org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer$1.readImpl(XSLTTransformer.java:208)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:96)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:94)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:348)
        at org.orbeon.oxf.processor.IdentityProcessor$1.readImpl(IdentityProcessor.java:33)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:96)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:94)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor$1.readImpl(ConcreteChooseProcessor.java:122)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:348)
        at org.orbeon.oxf.processor.IdentityProcessor$1.readImpl(IdentityProcessor.java:33)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:96)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:94)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:348)
        at org.orbeon.oxf.processor.IdentityProcessor$1.readImpl(IdentityProcessor.java:33)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:96)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:94)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor$1.readImpl(ConcreteChooseProcessor.java:122)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:348)
        at org.orbeon.oxf.processor.IdentityProcessor$1.readImpl(IdentityProcessor.java:33)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:96)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:66)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:94)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor$1.readImpl(ConcreteChooseProcessor.java:122)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.pipeline.TeeProcessor.access$100(TeeProcessor.java:36)
        at org.orbeon.oxf.processor.pipeline.TeeProcessor$1.readImpl(TeeProcessor.java:57)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:975)
        at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1158)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:343)
        at org.orbeon.oxf.processor.ProcessorImpl.readInputAsDOM4J(ProcessorImpl.java:398)
        at org.orbeon.oxf.processor.ProcessorImpl$4.read(ProcessorImpl.java:422)
        at org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsObject(ProcessorImpl.java:464)
        at org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsDOM4J(ProcessorImpl.java:420)
        at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:185)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$11.run(PipelineProcessor.java:652)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:508)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:649)
        at org.orbeon.oxf.processor.PageFlowControllerProcessor.start(PageFlowControllerProcessor.java:416)
        at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:88)
        at org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:95)
        at org.orbeon.oxf.servlet.OXFServletDelegate.service(OXFServletDelegate.java:129)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.orbeon.oxf.servlet.OXFServlet.service(OXFServlet.java:74)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)

===========

-----Original Message-----
From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
Sent: 18 October 2005 14:51
To: [hidden email]
Subject: Re: [ops-users] <xsl:include ... > - how to make it work!

Stephen,

Glad you have a workaround. It would still be good to have a stack trace
and/or a reproduceable case, se we can fix the bug.

-Erik

Stephen Bayliss wrote:

> Erik
>
> Actually, the stylesheet input was being dynamically generated, but was
> doing the include in this way <xsl:include href="oxf:/test/file.xsl"/>
> so I still expected it to work.
>
> However on knocking up a few example test cases, retrieving the
> stylesheet as:
> - href in an identity processor
> - url-generator used to retrieve stylesheet
> - oxf:xslt retrieving it with a <xsl:copy-of
> select="doc('/test/file.xsl')/."/>
>
> Only the third one does not work (whatever syntax I use for the href in
> the xsl:include, oxf or not, path or not).
>
> As it happens I can rewrite my original processor to avoid this dynamic
> generation, so it looks like it will be ok.
>
>
> -----Original Message-----
> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
> Sent: 18 October 2005 13:35
> To: [hidden email]
> Subject: Re: [ops-users] <xsl:include ... > - how to make it work!
>
> Steve,
>
> There are several uses of xsl:include in OPS itself, in particular
> theme.xsl includes formatting.xsl. This ought to work. You are not
> generating the initial stylesheet dynamically, right?
>
> Exactly how did you write your xsl:include statement, and then what
> exactly does the stack trace show? Do you have the same behavior with
> xsl:import?
>
> -Erik
>
> Stephen Bayliss wrote:
>
>>When running an XSL transform from oxf:xslt, it keeps falling over
>
> with
>
>>a null pointer exception whenever it hits an <xsl:include .. >
>
> statement.
>
>>
>>
>>The included file is in the same directory as the original XSLT.  I've
>
>
>>tried using no path, full directory path, oxf: style path, but nothing
>
>
>>seems to work!
>>
>>
>>
>>Has anyone successfully run an oxf:xslt pipeline process where the
>>stylesheet is in a file, and uses <xsl:include ... > to href another
>
> file?
>
>>
>>
>>Steve
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws