You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steve McNally <Mc...@synamic.co.uk> on 2000/11/16 18:11:29 UTC

Help on Taglibs and Namespace

Hi all

I need some help please. I am using XSP for the first time and am trying to
get my head around the taglibs and namespaces. I thought I had it worked out
until I tried and got the following error

org.apache.xalan.xslt.XSLProcessorException: pattern = '' Empty expression!
at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1674) at
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java:7
38) at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:572)
at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va:101) at
org.apache.cocoon.processor.xsp.XSPLogicsheet.apply(XSPLogicsheet.java:102)
at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:389)
at org.apache.cocoon.Engine.handle(Engine.java:359) at
org.apache.cocoon.Cocoon.service(Cocoon.java:167) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:160) at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
) at java.lang.Thread.run(Thread.java:484) 

I am using Cocoon 1.8

These are the files that I am using
news-xsp.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsp="http://www.apache.org/1999/XSP/Core" xmlns:research="/News-xsp">

<xsl:template match="">

<xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>
<xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">href="XSPTest"
type="text/xsl"</xsl:processing-instruction>
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
	<xsl:copy>
		<xsl:apply-templates match="@*|*|text()"/>
	</xsl:copy>
	<xsp:structure>
		<xsp:include>com.silacom.mobiquote.research</xsp:include>
		<xsp:include>com.silacom.mobiquote.framework</xsp:include>
	</xsp:structure>
	<xsp:logic>
		/* This is where the Java  Logic is performed */
		private static String getResearchData(int userid) {
			return "This is the news text";
		}
	</xsp:logic>
	<xsl:apply-templates/>
</xsp:page>
</xsl:template>

<xsl:template match="researchgenerate_news">
	<xsp:expr>
		getResearchData(1)
	</xsp:expr>
</xsl:template>

<xsl:template match="@*|*|text()">
   <xsl:copy>
     <xsl:apply-templates select="@*|*|text()"/>
   </xsl:copy>
</xsl:template>
</xsl:stylesheet>

and

<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-logicsheet href="/news-xsp.xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:research="/News-xsp">
	<news>
		<research:generate_news></research:generate_news>
	</news>
</xsp:page>

My question is could someone give me a pointer on if this is wrong where and
how ? I have added the location of news-xsp to the cocoon.properties file.
Also is my namespace declaration correct ? 

Cheers
Steve

Steve McNally
m-commerce Consultant
Sila Communications

E-mail : Steve.McNally@Synamic.co.uk
Tel : 0207 796 7054


Re: Help on Taglibs and Namespace

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 16 Nov 2000, Steve McNally wrote:

> Hi all
> 
> I need some help please. I am using XSP for the first time and am trying to
> get my head around the taglibs and namespaces. I thought I had it worked out
> until I tried and got the following error
> 
> org.apache.xalan.xslt.XSLProcessorException: pattern = '' Empty expression!

run your stylesheet through xalan standalone to see what the problem is
(your XSLT is invalid).

java org.apache.xalan.xslt.Process -xsl mine.xsl

> I am using Cocoon 1.8
> 
> These are the files that I am using
> news-xsp.xsl
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core" xmlns:research="/News-xsp">
> 
> <xsl:template match="">
> 
> <xsl:processing-instruction
> name="cocoon-process">type="xsp"</xsl:processing-instruction>

bad! wrong! you don't want to invoke the xsp processor _twice_!

> <xsl:processing-instruction
> name="cocoon-process">type="xslt"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">href="XSPTest"
> type="text/xsl"</xsl:processing-instruction>

same here - why are you applying styling instructions twice?

- donald