cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francois Swiegers <franco...@meb.co.za>
Subject Problem with namespaces
Date Wed, 19 Jul 2000 13:51:30 GMT
I have a problem using namespaces in XSP.

Environment:

Linux (RedHat 6.1)
Apache 1.3.12
Tomcat 3.1
Cocoon 1.7.4

This is what my XSP looks like:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-stylesheet href="error.html.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core">
  <mynamespace:root-element xmlns:mynamespace="http://www.meb.co.za">
    tralala
  </mynamespace:root-element>
</xsp:page>

This is how the XSL looks.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:mynamespace="http://www.meb.co.za">

<xsl:strip-space elements="*"/>

<xsl:template match="mynamespace:root-element">
  <xsl:processing-instruction name="cocoon-format">
    type=text/html
  </xsl:processing-instruction>
  <html>
    <xsl:value-of select="."/>
  </html>
</xsl:template>
</xsl:stylesheet>

When I run these in Cocoon, I get the following error:

	org.apache.xalan.xslt.XSLProcessorException: Warning: can't output
text before document element!  Ignoring...
		at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630)
		at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1594)
		at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:655)
		at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va:101)
		at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:11
0)
		at org.apache.cocoon.Engine.handle(Engine.java:305)
		at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
		at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
		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.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:156)
		at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
		at java.lang.Thread.run(Thread.java:475)
	---------
	org.xml.sax.SAXException: Warning: can't output text before document
element!  Ignoring...
		at
org.apache.xalan.xpath.xml.FormatterToDOM.append(FormatterToDOM.java:147)
		at
org.apache.xalan.xpath.xml.FormatterToDOM.characters(FormatterToDOM.java:330
)
		at
org.apache.xalan.xslt.XSLTEngineImpl$ResultTreeHandler.characters(XSLTEngine
Impl.java:3917)
		at
org.apache.xalan.xslt.XSLTEngineImpl.cloneToResultTree(XSLTEngineImpl.java:1
998)
		at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1172)
		at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1056)
		at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:748)
		at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:403)
		at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:296)
		at org.apache.xalan.xpath.XPath.locationPath(XPath.java:964)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:1385)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:1354)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:311)
		at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp
lateElement.java:894)
		at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
		at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:659)
		at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1194)
		at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1056)
		at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:748)
		at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:403)
		at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:296)
		at org.apache.xalan.xpath.XPath.locationPath(XPath.java:964)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:1385)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:1354)
		at org.apache.xalan.xpath.XPath.execute(XPath.java:311)
		at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp
lateElement.java:894)
		at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
		at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:659)
		at
org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
		at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:440)
		at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:631)
		at
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va:101)
		at
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:11
0)
		at org.apache.cocoon.Engine.handle(Engine.java:305)
		at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
		at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
		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.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:156)
		at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
		at java.lang.Thread.run(Thread.java:475)

The problem only occurs when I am using my own custom namespaces
(mynamespace). If I drop the namespace, everything works fine.

Is there anyone out there who can help me with this?

Mime
View raw message