cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Engelhart <mengelh...@earthtrip.com>
Subject Re: xalan namespace not found
Date Fri, 25 Feb 2000 00:15:07 GMT
Scott Boag/CAM/Lotus wrote:

> This has nothing to do with your problem, it referes to the namespace axes,
> as in select="namespace::foo".  It has since been implemented.
> 
> Your error seems strange, and I've not seen it before.  We just did some
> work on the namespace handling in stylesheets (namely for performance
> reasons), so perhaps this is fixed.
> 
> -scott
> 
I just dropped in xalan_0_19_5 into Cocoon and restarted and got the same
message:

org.apache.xalan.xslt.XSLProcessorException: ElemTemplateElement error: Can
not resolve namespace prefix: java
    at org.apache.xalan.xslt.XSLTEngineImpl.error(Compiled Code)
    at org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
    at org.apache.xalan.xslt.XSLTEngineImpl.process(Compiled Code)
    at org.apache.cocoon.transformer.XalanTransformer.transform(Compiled
Code)
    at org.apache.cocoon.processor.xslt.XSLTProcessor.process(Compiled Code)
    at org.apache.cocoon.Engine.handle(Compiled Code)
    at org.apache.cocoon.Cocoon.service(Compiled Code)
    at javax.servlet.http.HttpServlet.service(Compiled Code)
    at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled Code)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
    at org.apache.tomcat.core.ContextManager.service(Compiled Code)
    at 
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Compiled Code)
    at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
    at java.lang.Thread.run(Compiled Code)

I thought the problem was because I was importing a stylesheet  that
contained the java variable declarations but i moved them directly into the
stylesheet and it still gave me the error.

I made a really simple example using an XSP and stylesheet:


<!-- XSP -->
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<?xml-stylesheet href="../xsl/test.xsl" type="text/xsl"?>
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
    <DECK RESOURCEBUNDLE="com.earthtrip.resource.Pages">
        <xsp:attribute name="LANGUAGE">
            <xsp:expr>request.getLocale().getLanguage()</xsp:expr>
        </xsp:attribute>
        <xsp:attribute name="COUNTRY">
            <xsp:expr>request.getLocale().getCountry()</xsp:expr>
        </xsp:attribute>
    </DECK>
</xsp:page>

<!-- style -->

<?xml version="1.0"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"  
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java">

    <xsl:import href="../globals.xsl"/>
    <xsl:template match="/">
        <HTML>
            <BODY>
                <H1> TESTING </H1>
            </BODY>
        </HTML>
    </xsl:template>
</xsl:stylesheet>


where globals.xsl contains this:
<?xml version="1.0"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"  
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java">

    <!-- LOCALIZATION VARIABLES -->
    <xsl:variable name="resource" select="string(//@RESOURCEBUNDLE)"/>
    <xsl:variable name="language" select="string(//@LANGUAGE)"/>
    <xsl:variable name="country" select="string(//@COUNTRY)"/>
    <xsl:variable name="locale" select="java:java.util.Locale.new($language,
$country)"/>
    <xsl:variable name="bundle"
select="java:java.util.ResourceBundle.getBundle($resource, $locale)"/>
</xsl:stylesheet>


This worked without any errors.  Another error that I'm getting though which
may or may not have to do with it is this is showing up on the console:

> XSL Error: SAX Exception
> XSL Warning: xsl:stylesheet requires a 'version' attribute!

The version attribute is definitely in there but on the pages that have
problems with the java namespace i also get those.  In case I didn't mention
it, I didn't make any changes before installing xalan 0.19.4 or 0.19.5.
They just haven't been working..Any ideas on where to go with this?

Thanks,
Mike


Mime
View raw message