Subject: Re: [xsl] collecting a fileset with XSLT 2.0 From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 06 Feb 2012 15:46:39 -0500 |
Thanks Wendell, also good to know. In this project I ran out of time and couldn't take the time to work out how to use collection(), so I handled it elsewise. collection() would have required a ton of refactoring on this project. I realized I mainly needed to exclude a couple files, so I embedded a little lookup table in the stylesheet that holds a couple strings:
<st:exclude> <st:file name="filename1.xml"/> <st:file name="filename2.xml"/> </st:exclude>
Then I made a key to parse it:
<xsl:variable name="excluded-files" select="document('')/xsl:stylesheet/st:exclude"/>
<xsl:variable name="excluded-files" as="element(st:file)+"> <st:file name="filename1.xml"/> <st:file name="filename2.xml"/> ... </xsl:variable>
Cheers, Wendell
<!-- Key to parse $excluded-files. --> <xsl:key name="excluded" match="st:file" use="@name"/>
And excluded those files by testing it with key():
<xsl:when test="exists(key('excluded', $thisfile, $excluded-files))"> <!-- do nothing --> </xsl:when>
Maybe later I can get cooler with collection().
-- ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] collecting a fileset with, Mark Giffin | Thread | Re: [xsl] collecting a fileset with, Mark Giffin |
Re: [xsl] collecting a fileset with, Mark Giffin | Date | Re: [xsl] collecting a fileset with, Mark Giffin |
Month |