Hi again.
I wrote wrong before, I DID use single quotes like this:
document('/mickel/XML/xml_file.xml')
Anyway, I have experimented a bit, and neither absolute or relative paths
like document('../../XML/xml_file.xml') work!
I seems to only be able to access XML files that reside in THE SAME FOLDER
as the XSL file where I call document.
I have even tried putting the XML file in a sub folder instead, and trying
document('XML/xml_file.xml')
So the XSL file resides in mickel/XSL/PC and the XML file in
mickel/XSL/PC/XML.
And yes, the "mickel" folder is in the web root folder.
I can't understand why I can't access any XML file that is outside of the
folder where document is called!
Do you have any idea what could be wrong? The error I get is "The object
can't be found". Everything works fine if the XML file resides in the same
folder as the XSL file.
/Gabriel
----- Original Message -----
From: "M. David Peterson" <m(_dot_)david(_at_)mdptws(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Sunday, November 07, 2004 3:33 AM
Subject: Re: [xsl] document()
Hello Gabriel,
There are two ways to use the document() function. One is to use a string
representation of the path to the directory in which the file is
contained. To tell the processor that this is a string representation you
need to use single quotes:
document('/mickel/XML/xml_file.xml')
Keep in mind that this will only work if 'mickel' is at the root of your
directory. Another way to locate the correct file would be to use:
document('../../XML/xml_file.xml')
Your current approach tells the processor to locate the 'xml_file.xml'
child element of /mickel/XML and use its value as a string
representation of the file to use which, if it does not exist, will simply
be ingored and leave you with an empty string for the document() function
to work with. Obviously an empy string doesnt do a lot for you.
Hope this helps!
Regards,
<M:D/>
Gabriel K. wrote:
I want to open an xml file that resides in a folder that is a above the
xsl file in which document() is used (to access the xml file).
The XSL file resides here (under the web root):
/mickel/XSL/PC/
and the XML file resides here (under the web root);
/mickel/XML
I have tried to use document(/mickel/XML/xml_file.xml), but it doesn't
seem to work. Should this work? Can I reference the web root folder with
"/"?
/Gabriel
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--