xsl-list
[Top] [All Lists]

RE: Using Saxon 8.5 and collection() to process a directory of XML files

2005-08-04 09:24:58
Try file:///test...

I have found that, for local files (on the same drive), I need to use URIs 
of the following form: file:///path/from/root/to/file.xml
(You get three / characters because the protocol needs two and the third 
one specifies the root of the current drive.)

For remote files (not on the same drive), I use URIs of the following 
form: file:////server-name/path/from/root/to/file.xml
(Yes, that's four / characters, two for the protocol and two to indicate a 
server.)

Relative paths are a bit trickier but possible.

That's not what you asked, but, since I have already fought that 
battle....

I also look forward to seeing more about using collection() to get files. 
I have written my own extension function for Saxon 8.* to get file names 
from a directory, but I can certainly stand to know another way to do it.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




"Welch Andrew (ELS)" <A(_dot_)Welch(_at_)Elsevier(_dot_)com> 
08/04/2005 10:50 AM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
RE: [xsl] Using Saxon 8.5 and collection() to process a directory of XML 
files






 
Mike,

Can you just confirm the syntax for using collection() to process a
directory of xml files?

I'm using:

collection('file:///c:/test?select=*.xml')

But this gives the error:

  FODC0005: java.io.FileNotFoundException: c:\test\xml?select=*.xml (The
filename, directory
  name, or volume label syntax is incorrect)
Error on line 21 of file:/C:\Test\XSL\test.xsl:
  Failed to load collection catalogue file:///c:/test/xml?select=*.xml
Transformation failed: Run-time errors were reported

Once that problem is solved, how do you go about getting a document out of
it?

Something like for $i in collection(...) return doc($i) ?

Thanks
Andrew



--~------------------------------------------------------------------
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>
--~--