You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Vincent-Olivier Arsenault <vi...@stria.com> on 2000/01/07 00:10:42 UTC

xsl:output, xsl:include, xsl:import support and file base

xsl:output, xsl:include and xsl:import don't work.

<xsl:output method="html"/> and xsl:include do absolutly nothing and
xsl:import always generates the "must be on top of stylesheet error". Maybe
it's me but then, may I have a working example? I'm using cocoon.

second thing, in cocoon, if i include a xsl in another xsl with <xsl:include
href="category.xsl"/> (because the included xsl is in the same directory),
it says cannot find file:/usr/local/category.xsl, but if I write
<xsl:include href="file:/usr/local/fusion3/root/xper/category.xsl"/> there
is no error message (it still doesn't work tough).


thanks

--vincent


Re: xsl:output, xsl:include, xsl:import support and file base

Posted by Vincent-Olivier Arsenault <vi...@stria.com>.
Hi!

I just downloaded the cvs tree this morning (xalan + cocoon). xsl:output
seems to work except for indent="yes" (i don't even know if it supposed to
be a feature anyways, but i've seen it in some xsl in xalan).

but still nothing for xsl:include nor xsl:import

----- Original Message -----
From: "Stefano Mazzocchi" <st...@apache.org>
To: <ge...@xml.apache.org>
Sent: Thursday, January 06, 2000 7:20 PM
Subject: Re: xsl:output, xsl:include, xsl:import support and file base


> Vincent-Olivier Arsenault wrote:
> >
> > xsl:output, xsl:include and xsl:import don't work.
> >
> > <xsl:output method="html"/> and xsl:include do absolutly nothing and
> > xsl:import always generates the "must be on top of stylesheet error".
Maybe
> > it's me but then, may I have a working example? I'm using cocoon.
> >
> > second thing, in cocoon, if i include a xsl in another xsl with
<xsl:include
> > href="category.xsl"/> (because the included xsl is in the same
directory),
> > it says cannot find file:/usr/local/category.xsl, but if I write
> > <xsl:include href="file:/usr/local/fusion3/root/xper/category.xsl"/>
there
> > is no error message (it still doesn't work tough).
>
> have you tried
>
>  file:///usr/local/....
>
> this is the right syntax for the "file" protocol.

yes, and then it "works" (no more file not found error), but what if i want
relative path like xcv/index.xsl ?

yet, if i try xsl:import i get:



              org.apache.xalan.xslt.XSLProcessorException:
(StylesheetHandler) Imports can only occur as the first elements in the
stylesheet!
                      at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java, Compiled
Code)
                      at
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java,
Compiled Code)
                      at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, Compiled
Code)
                      at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va, Compiled Code)
                      at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java,
Compiled Code)
                      at org.apache.cocoon.Engine.handle(Engine.java,
Compiled Code)
                      at org.apache.cocoon.Cocoon.service(Cocoon.java,
Compiled Code)
                      at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
                      at
org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
26)
                      at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
Compiled Code)
                      at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
                      at
org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
                      at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
                      at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java, Compiled Code)
                      at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java, Compiled
Code)
                      at java.lang.Thread.run(Thread.java, Compiled Code)
              ---------
              org.xml.sax.SAXException: (StylesheetHandler) Imports can only
occur as the first elements in the stylesheet!
                      at
org.apache.xalan.xslt.StylesheetHandler.processImport(StylesheetHandler.java
:1165)
                      at
org.apache.xalan.xslt.StylesheetHandler.startElement(StylesheetHandler.java,
Compiled Code)
                      at
org.apache.xalan.xpath.xml.TreeWalker.startNode(TreeWalker.java, Compiled
Code)
                      at
org.apache.xalan.xpath.xml.TreeWalker.traverse(TreeWalker.java, Compiled
Code)
                      at
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java,
Compiled Code)
                      at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, Compiled
Code)
                      at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va, Compiled Code)
                      at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java,
Compiled Code)
                      at org.apache.cocoon.Engine.handle(Engine.java,
Compiled Code)
                      at org.apache.cocoon.Cocoon.service(Cocoon.java,
Compiled Code)
                      at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
                      at
org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
26)
                      at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
Compiled Code)
                      at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
                      at
org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
                      at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
                      at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java, Compiled Code)
                      at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java, Compiled
Code)
                      at java.lang.Thread.run(Thread.java, Compiled Code)


and with xsl:include:

org.apache.xerces.dom.DOMExceptionImpl: HIERARCHY_REQUEST_ERR
                       at
org.apache.xerces.dom.NodeImpl.internalInsertBefore(NodeImpl.java, Compiled
Code)
                       at
org.apache.xerces.dom.NodeImpl.insertBefore(NodeImpl.java, Compiled Code)
                       at
org.apache.xerces.dom.DocumentImpl.insertBefore(DocumentImpl.java, Compiled
Code)
                       at
org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java, Compiled Code)
                       at
org.apache.xalan.xpath.xml.FormatterToDOM.append(FormatterToDOM.java,
Compiled Code)
                       at
org.apache.xalan.xpath.xml.FormatterToDOM.characters(FormatterToDOM.java,
Compiled Code)
                       at
org.apache.xalan.xslt.XSLTEngineImpl$ResultTreeHandler.characters(XSLTEngine
Impl.java, Compiled Code)
                       at
org.apache.xalan.xslt.XSLTEngineImpl.cloneToResultTree(XSLTEngineImpl.java,
Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp
lateElement.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java,
Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp
lateElement.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java,
Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java, Compiled Code)
                       at
org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java, Compiled Code)
                       at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:398)
                       at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, Compiled
Code)
                       at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va, Compiled Code)
                       at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java,
Compiled Code)
                       at org.apache.cocoon.Engine.handle(Engine.java,
Compiled Code)
                       at org.apache.cocoon.Cocoon.service(Cocoon.java,
Compiled Code)
                       at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
                       at
org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:6
26)
                       at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
Compiled Code)
                       at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
                       at
org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
                       at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
                       at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java, Compiled Code)
                       at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java, Compiled
Code)
                       at java.lang.Thread.run(Thread.java, Compiled Code)

i've included my xml and xsl in a zip file. of course you'll need to change
the absolute path in index.xsl

thanks

--vincent


Re: xsl:output, xsl:include, xsl:import support and file base

Posted by Stefano Mazzocchi <st...@apache.org>.
Vincent-Olivier Arsenault wrote:
> 
> xsl:output, xsl:include and xsl:import don't work.
> 
> <xsl:output method="html"/> and xsl:include do absolutly nothing and
> xsl:import always generates the "must be on top of stylesheet error". Maybe
> it's me but then, may I have a working example? I'm using cocoon.
> 
> second thing, in cocoon, if i include a xsl in another xsl with <xsl:include
> href="category.xsl"/> (because the included xsl is in the same directory),
> it says cannot find file:/usr/local/category.xsl, but if I write
> <xsl:include href="file:/usr/local/fusion3/root/xper/category.xsl"/> there
> is no error message (it still doesn't work tough).

have you tried

 file:///usr/local/....

this is the right syntax for the "file" protocol.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------