You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Nick Bastin <nb...@opnet.com> on 2004/03/10 21:50:50 UTC

Behaviour of select="document(foo)"

In the expression:

<xsl:variable name="msg_lib" select="document($msg_lib_name)"/>

$msg_lib_name is assumed to be in the same directory as the binary 
doing the transformation.  Is this behaviour modifiable (i.e., pull 
from the same directory as the XSL file, or relative to it), or should 
we always specify the full path?

--
Nick


Re: Behaviour of select="document(foo)"

Posted by da...@us.ibm.com.



Hi Nick,

You can read the gory details of the document() function here:

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

In this specific case, if you are really seeing behavior where the parser
is assuming the current directory of the executable, then that is a
problem, and we should look into why it's happening.  The URI reference
should be resolved relative to the location of the stylesheet.

Xerces-C also has a general entity resolver mechanism which you can use if
you need more control over how external entities are resolved.

Dave



|---------+--------------------------->
|         |           Nick Bastin     |
|         |           <nbastin@opnet.c|
|         |           om>             |
|         |                           |
|         |           03/10/2004 12:50|
|         |           PM              |
|         |           Please respond  |
|         |           to xalan-c-users|
|---------+--------------------------->
  >-------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                 |
  |        To:      xalan-c-users@xml.apache.org                                                                                                    |
  |        cc:      (bcc: David N Bertoni/Cambridge/IBM)                                                                                            |
  |        Subject: Behaviour of select="document(foo)"                                                                                             |
  >-------------------------------------------------------------------------------------------------------------------------------------------------|



In the expression:

<xsl:variable name="msg_lib" select="document($msg_lib_name)"/>

$msg_lib_name is assumed to be in the same directory as the binary
doing the transformation.  Is this behaviour modifiable (i.e., pull
from the same directory as the XSL file, or relative to it), or should
we always specify the full path?

--
Nick