xsl-list
[Top] [All Lists]

Re: [xsl] fixing XSL search using values from a variable against multiple XML files

2018-10-03 20:50:45
On Thu, Oct 04, 2018 at 01:42:19AM -0000, Dave Lang 
emaildavelang(_at_)gmail(_dot_)com scripsit:
Thanks for your reply, Graydon. I don't need to worry about not finding
anything right now - the rest of the xsl is working - it's this part that is
causing problems.

I know (I think) that it's missing a </xsl:for-each> but for some reason
Oxygen won't accept another one. Also the if test references a variable that
isn't declared but I'm not sure what's going on with the search so I don't
know what to put there.

<xsl:template match="/">
    <xsl:for-each select="collection('.?select=*.xml;recurse=yes')"/>

As you've written it here, this for-each doesn't do anything.  It's
closed.  Get rid of that / at the end.

    <xsl:variable name="xml_filenames" select="."/>
        <xsl:for-each select="$filenames_to_find">
            <xsl:if test="(contains($t, .))">

Where does $t come from?  Are you sure it's in scope?

                <xsl:message>{document-uri($xml_filenames)} contains
{.}</xsl:message>
            </xsl:if>
        </xsl:for-each>

</xsl:for-each>

</xsl:template>

From an efficiency standpoint, this is nigh-certainly not what you want.

-- Graydon
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>