Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 7095 invoked from network); 31 Jan 2004 01:10:16 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 31 Jan 2004 01:10:16 -0000 Received: (qmail 70312 invoked by uid 500); 31 Jan 2004 01:09:53 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 70265 invoked by uid 500); 31 Jan 2004 01:09:53 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 70236 invoked from network); 31 Jan 2004 01:09:52 -0000 Received: from unknown (HELO mail.gmx.net) (213.165.64.20) by daedalus.apache.org with SMTP; 31 Jan 2004 01:09:52 -0000 Received: (qmail 29949 invoked by uid 65534); 31 Jan 2004 01:09:59 -0000 Received: from Afd94.a.pppool.de (EHLO gmx.de) (213.6.253.148) by mail.gmx.net (mp018) with SMTP; 31 Jan 2004 02:09:59 +0100 X-Authenticated: #3483660 Message-ID: <401B00E9.8010103@gmx.de> Date: Sat, 31 Jan 2004 02:12:09 +0100 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: de-de, de, en-us, en-gb, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: strange behavior in xslt transformation with document() References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 31.01.2004 00:51, BURGHARD Eric wrote: > Hi everybody, > > While playing with forrest/cocoon/xslt, i found something very strange. > > I've got two different behavior of a document() function inside an xslt > stylesheet. I don't know if it's a bug or a feature. > > If document() takes its parameter from a stylesheet variable ($filename), > xalan try to load the file from the same directory than the .xsl file. > > If it takes its parameter from an attribute of the .xml which is being > transformed (@filename), it try to load the file from the same directory > than the .xml file. > > Any idea ? If that's true, it's definitely a bug. Using document() without a second parameter should resolve the path relative to the stylesheet. Only passing a node-set as second argument changes this behaviour, the path is resolved relative to this node-set: "The URI reference may be relative. The base URI (see [3.2 Base URI]) of the node in the second argument node-set that is first in document order is used as the base URI for resolving the relative URI into an absolute URI. If the second argument is omitted, then it defaults to the node in the stylesheet that contains the expression that includes the call to the document function. Note that a zero-length URI reference is a reference to the document relative to which the URI reference is being resolved; thus document("") refers to the root node of the stylesheet; the tree representation of the stylesheet is exactly the same as if the XML document containing the stylesheet was the initial source document." (XSLT spec, 12.1 Multiple Source Documents, http://www.w3.org/TR/xslt#document) Joerg