xsl-list
[Top] [All Lists]

Re: document()

2004-11-06 19:33:40
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>
--+--




<Prev in Thread] Current Thread [Next in Thread>