[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] include, document and namespaces
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|