You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ruben <ri...@alu.ua.es> on 2001/06/20 21:54:50 UTC
namespaces, document() and include
Hi everybody!
I have found a very strange behaviour using XSL under Tomcat with
Cocoon (in Linux) when I mix namespaces and includes.
Suppose I have 4 documents:
a) A.xml -> procesed by A.xsl
b) A.xsl -> processes A.xml, acceses B.xml with 'document()' and
includes C.xsl
c) B.xml -> with some data I want to retrieve from A.xsl. Uses
xsp:namespace
d) C.xsl -> with some functions used by A.xsl
The problem: when (and only when) I include C.xsl inside A.xsl I cannot
access the data in B.xml; I get the error: 'cannot load requested doc'.
I've tried to reduce the files to the minimum, but I still have the same
problem.
Here you have the reduced examples of the files:
A.xml
---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet type="text/xsl" href="/xsl/A.xsl"?>
<nothing>
</nothing>
---------------------------------------
A.xsl
---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<!-- When I comment this line I have no problems at all -->
<xsl:include href="C.xsl" />
<xsl:template match="/">
<html>
<xsl:value-of select="document('B.xml')//nombre" />
</html>
</xsl:template>
</xsl:stylesheet>
---------------------------------------
B.xml
---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet type="text/xsl" href="D.xsl"?>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:accesoBD="http://www.e-inteligentia.com/accesoBD">
<nombre>the data I want to retrieve</nombre>
</xsp:page>
---------------------------------------
C.xsl
---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<!-- Even if it does nothing I get the problem -->
</xsl:stylesheet>
---------------------------------------
What am I doing wrong? Have I forgotten to declare a namespace or
something? Is it a Cocoon problem? I would really appreciate any help,
thank you in advance...
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>