[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

include, document and namespaces

Subject: include, document and namespaces
From: Ruben Inoto <ris2@xxxxxxxxx>
Date: Wed, 20 Jun 2001 17:58:47 +0200
xml include document
 Hi everybody!

 I have found a very strange behaviour using XSL under Tomcat with
Cocoon 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...



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.