[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|