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

Re: fixing XSL search using values from a variable ag

Subject: Re: fixing XSL search using values from a variable against multiple XML files
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Oct 2018 01:33:03 -0000
Re:  fixing XSL search using values from a variable  ag
On Thu, Oct 04, 2018 at 01:16:05AM -0000, Dave Lang emaildavelang@xxxxxxxxx scripsit:
>     <xsl:variable name="filenames_from_directory_listing" as="xs:string"
> select="unparsed-text('filenames_from_directory_listing.txt')"/>
>     <xsl:variable name="filenames_to_find"
> select="tokenize($filenames_from_directory_listing, '\s+')"/>

>     <xsl:template match="/">

Stick this in a message:
<xsl:message><xsl:sequence select="count($filenames_to_find)"/></xsl:message>

to makes sure there's something in there, first thing in the template.
(Easiest way for this to fail is to not load the list.)

>         <xsl:for-each select="collection('.?select=*.xml;recurse=yes')"/>
>             <xsl:variable name="xml_filenames" select="."/>
>                 <xsl:for-each select="$filenames_to_find">
>                     <xsl:if test="(contains($t, .))">
> <xsl:message>{document-uri($xml_filenames)} contains {.}</xsl:message>
>                     </xsl:if>
>                 </xsl:for-each>
>     </xsl:template>
> </xsl:stylesheet>

I'd recommend looking at the file:list() extension function.
(http://expath.org/spec/file#fn.list)

I'd also recommend sticking the file list in a variable, and adding
another message so you can tell if you found anything there.

Once you're sure you finding things, then work on the search logic.

-- Graydon

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.