[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using XSLT to process a directory of mixed files

Subject: Re: Using XSLT to process a directory of mixed files
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 8 May 2019 06:50:41 -0000
Re:  Using XSLT to process a directory of mixed files
Am 08.05.2019 um 04:40 schrieb dvint@xxxxxxxxx:
> I'm trying to use a collection() to process all files in a directory.
> The directory may have text, pddf, images files in addition to my DITA
> file. I've created this little test
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> exclude-result-prefixes="xs"
> version="2.0">
>
>
<xsl:variablename="fileSet"select="/collection/('/Users/danvint/pubsrc-other/
formatting-sample?select=*.*;recurse=yes')"/>
> <xsl:templatematch="/">
> <xsl:apply-templatesselect="*$fileSet*"mode="collectionprocessing"/>
>
> </xsl:template>
>
> <xsl:templatematch="/"mode="collectionprocessing">
> '<xsl:value-ofselect="/document-uri/()"/>'
> <xsl:value-ofselect="/doc-available/(/document-uri/())"/>
> </xsl:template>
> </xsl:stylesheet>
>
>

Note that in XSLT/XPath 3 there is also a uri-collection function you
can use to simply get a sequence/collection of URIs instead of having to
load the complete files:
https://www.w3.org/TR/xpath-functions/#func-uri-collection


Arguments for Saxon should be the same as for collection.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.