xsl-list
[Top] [All Lists]

Re: [xsl] How to read an XML file that is in a subfolder or sub-subfolder or sub-sub-subfolder or ...?

2020-04-07 08:14:06
Assuming your processor can map a file system directory to a collection, you 
can use the fn:uri-collection() function to get all the URIs of files in the 
collection and then search them to find the one you are looking for.

An alternative would be to use the functions in the EXPath file module, which 
gives explicit access to concepts like folders and files.

Michael Kay
Saxonica

On 7 Apr 2020, at 14:06, Costello, Roger L. costello(_at_)mitre(_dot_)org 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi Folks,

My XSLT program has a variable $filename which contains the name of an XML 
file. The XML file is in a folder named "files" or one of its subfolders or 
one of its sub-subfolders or one of its sub-sub-subfolders or ...

In other words, it's somewhere in the tree of folders rooted at "files."

I want to open the XML file (wherever it's located within "files") and read 
it into an XSLT variable. Is there a way to do this?

/Roger

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>