[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: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 5 Oct 2018 13:26:37 -0000
Re:  fixing XSL search using values from a variable  ag
Hey Dave,

Sure thing, feel free. Be sure and bug me here so that "our crowd" can
join in. :-)

Note also that my solution was really a refinement/rewrite of your
solution -- taking your hint that this is what you wanted to try, I
worked from there. But there are other approaches both to the framing
of the query and to the test, as others have noted, a number of them
(typically) easier or more effective, depending on the case (and not
all XSLT neither as Syd wisely indicates).

Indeed, the brainstorming of totally new approaches (or refitting old
approaches unexpectedly) is one of the things this list is worth
reading for.

[Look ma, no XSLT just XPath]

<xsl:sequence
    select="collection('.?select=*.xml;recurse=yes')[some $f in
($filenames_to_find) satisfies contains(.,$f)]/document-uri(.)"/>

Also, if you keep your ears (eyes) open you may pick up some useful
info along the way, for example are you aware that your/our solution
fails if the file name mention is in an attribute value in the XML?
Maybe you/we don't care or maybe that's a feature.

So another caution is to be patient with us and our questions, as they
are not meant as a hindrance, but rather to elicit potentially
valuable info if only for framing context and avoiding rat holes.

Cheers, Wendell
On Thu, Oct 4, 2018 at 10:09 PM Dave Lang emaildavelang@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Thanks for your help, Wendell - I've got your suggested solution working
> now. I'm sure I'll be back to bug you with some questions (but not
> before I try to find the answers on my own first!).
>
> cheers,
>
> dave
>
> On 2018-10-04 10:47 AM, Wendell Piez wapiez@xxxxxxxxxxxxxxx wrote:
> > Dave,
> >
> > Yeah it looks like there might be a syntax error line 20 should perhaps have
> >
> >        <xsl:message>{document-uri(/)} contains {
> > string-join($filenames_here,', ') }</xsl:message>
> >
> > also this is under 3.0 with @expand-text ...
> 



-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

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.