Dir
Attributes
| URI: | http://www.xmlpipe.org/xpe/util/filter/dir |
| Type: | filter |
| Namespace: | http://www.xmlpipe.org/xpe/util |
| Owner: | http://www.xmlpipe.org/xpe |
Description
This filter lists the directory structure of a given directory on the server.
<u:dir
href="{base directory}"
expand="{yes|no}"
suffix="{file suffix, eg. .xhtml}"
xmlns:u="http://www.xmlpipe.org/xpe/util"
/>
The dir filter lists directories and files in the server. Note:
- @href, this attributes defines the top level file directory
- @expand, if it is set to 'yes', all child directories will be expanded.
- @suffix, optional, if set, only the files with the specified suffix is listed.
Example usage
The following example illustrates how the Dir filter could be used within an XPE pipeline definition (xpipedef.xml) file:
<register
uri="dir"
xmlns="http://www.xml.org/xml/pipe"
>
<xpipe>
<xnode
type="http://www.xml.org/pipe/xpe/source/http"
/>
<xnode
type="xslt/dirfilter"
/>
<xnode
type="http://www.xmlpipe.org/xpe/util/filter/dir"
/>
<xsink
type="http://www.xml.org/pipe/xpe/sink/http"
>
<property
name="method"
value="xml"
/>
</xsink>
</xpipe>
</register>
If the XML stream passing through the dir filter encountered the following XML:
<u:dir
expand="yes"
href="file:/c:/tmp"
suffix=""
xmlns:u="http://www.xmlpipe.org/xpe/util"
/>
Then xml similar to the following would be produced:
<u:dir
expand="yes"
href="file:/c:/tmp"
suffix=""
xmlns:u="http://www.xmlpipe.org/xpe/util"
>
<u:dir
name="tmp"
href="file:/c:/tmp/"
>
<u:file
mimeType="application/octet-stream"
name="f1"
href="file:/c:/tmp/f1"
/>
<u:file
mimeType="application/octet-stream"
name="f3"
href="file:/c:/tmp/f3"
/>
<u:file
mimeType="application/octet-stream"
name="hs_err_pid5528.log"
href="file:/c:/tmp/hs_err_pid5528.log"
/>
</u:dir>
</u:dir>