Hi Per,

Yes, this behavior is correct, and is explicit in the XSLT recommendation:

   http://www.w3.org/TR/xslt#document

   "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."

The two argument call is available, if you need to provide a base URI.

Dave



                                                                                
                                        
                      Per Jessen                                                
                                        
                      <[EMAIL PROTECTED]         To:      
[email protected]                                    
                      g>                       cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                            
                      Sent by: news            Subject: how document() resolves 
a relative path                         
                      <[EMAIL PROTECTED]                                        
                                          
                      .org>                                                     
                                        
                                                                                
                                        
                                                                                
                                        
                      04/14/2003 02:17                                          
                                        
                      AM                                                        
                                        
                                                                                
                                        



I've just recently "discovered" something which I'm not certain
is correct.
I'm using XSLT function document() to read in a local file. WHen the
filepath is relative, document() tries to resolve it as relative to the
location of the .xsl file using document().

Eg. if I call the xalan command-line processor along these lines:

./xalan [options]  <xmldoc>  ../qwerty.xsl

a document('jessen/g7.xml') will try to access '../jessen/g7.xml' .

Is this correct/expected behaviour?


thanks,
Per Jessen, Zurich



Reply via email to