You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2001/03/01 02:08:47 UTC

Re: xsl:include conflicts...

chris markiewicz wrote:
> 
> since i converted to xalan2/sax2, i have noticed the following:
> 
> (in this example, x.xsl contains some utility templates)
> 
> if a.xsl includes x.xsl and b.xsl includes x.xsl AND a.xsl includes b.xsl, i
> get an error that more than one x.xsl template is available.
> 
> what is the fix for this?  the code is fairly modular so removing the
> include from a or b isn't really an option.
> 
> thanks
> chris

Chris --

Can you please send along a.xsl, b.xsl, x.xsl and the corresponding XML
so that we can try to reproduce this problem.

What is the exact error (incl stack trace, if possible) that you are
receiving.

TIA,
Gary

Re: xsl:include conflicts...

Posted by Gary L Peskin <ga...@firstech.com>.
chris markiewicz wrote:
> >
> > since i converted to xalan2/sax2, i have noticed the following:
> >
> > (in this example, x.xsl contains some utility templates)
> >
> > if a.xsl includes x.xsl and b.xsl includes x.xsl AND a.xsl includes b.xsl,
> i
> > get an error that more than one x.xsl template is available.
> >
> > what is the fix for this?  the code is fairly modular so removing the
> > include from a or b isn't really an option.
> >
> > thanks
> > chris

Chris --

XalanJ2 is correct in this regard.  See the last sentence in this
section:  <http://www.w3.org/TR/xslt.html#named-templates>.

To get around this, try including your stylesheets with xsl:import
instead of xsl:include.  Note that the xsl:imports must come immediately
after the xsl:stylesheet element, even though placing them somewhere
else is not currently reported as an error by Xalan, due to a bug.

Gary

RE: xsl:include conflicts...

Posted by chris markiewicz <cm...@commnav.com>.
gary

here is the info that you requested...

first, the stack trace is:

GMT Time:3/1/01 7:22 AM
java.lang.RuntimeException: ElemTemplateElement error: Found more than one
template named: fixQuotes
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:965)
	at
com.commnav.sbh.applications.wrappers.XSLXalan2SAXCache.getTemplatesObject(X
SLXalan2SAXCache.java:86)
	at
com.commnav.sbh.applications.wrappers.XSLXalan2SAXEngine.generateContent(XSL
Xalan2SAXEngine.java:123)
	at
com.commnav.sbh.applications.wrappers.XSLXalan2SAXEngine.generateContent(XSL
Xalan2SAXEngine.java:72)
	at
com.commnav.sbh.servlets.CommnavServlet.writeXSL(CommnavServlet.java:385)
	at
com.commnav.sbh.servlets.CommnavServlet.writeOutput(CommnavServlet.java:342)
	at com.commnav.sbh.servlets.PortalServlet.doPost(PortalServlet.java:169)
	at com.commnav.sbh.servlets.CommnavServlet.doGet(CommnavServlet.java:115)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
	at org.apache.tomcat.core.Handler.service(Handler.java:286)
	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
	at java.lang.Thread.run(Thread.java:484)

the three attached files are:

styleadministration.xsl - the main page to load - includes pidgettitlebar
and fixquotes
pidgettitlebar.xsl - also includes fixquotes
fixquotes.xsl - utility function

i tried to take all of the stuff that you won't have out of
styleadministration...it should still produce the error.  please let me know
what you find out.

chris







-----Original Message-----
From: Gary L Peskin [mailto:garyp@firstech.com]
Sent: Wednesday, February 28, 2001 8:09 PM
To: xalan-dev@xml.apache.org
Subject: Re: xsl:include conflicts...


chris markiewicz wrote:
>
> since i converted to xalan2/sax2, i have noticed the following:
>
> (in this example, x.xsl contains some utility templates)
>
> if a.xsl includes x.xsl and b.xsl includes x.xsl AND a.xsl includes b.xsl,
i
> get an error that more than one x.xsl template is available.
>
> what is the fix for this?  the code is fairly modular so removing the
> include from a or b isn't really an option.
>
> thanks
> chris

Chris --

Can you please send along a.xsl, b.xsl, x.xsl and the corresponding XML
so that we can try to reproduce this problem.

What is the exact error (incl stack trace, if possible) that you are
receiving.

TIA,
Gary