[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Query Through Multiple Files

Wei, Alice J. ajwei at indiana.edu
Sun Jan 20 09:16:30 PST 2008


  Query Through Multiple Files
Hi, Michanel:

   Thanks for pointing out the error I had with the distinct-values(),

    As for the point on using the template you provided, since I use the TEI, I don't think I could use it. I did use Liam's suggestions,

for $ad in (
       doc("1.xml"),
       doc("2.xml"),
       doc("3.xml"),
       doc("4.xml"))//ad

and the error tells me

 FORG0006: Effective boolean value is not defined for a sequence of two or more items
  starting with a string
Query processing failed: Run-time errors were reported

Is this the type of error I should be getting?
Thanks for your help.

======================================================
Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
http://x-query.com/mailman/listinfo/talk
________________________________________
From: Michael Kay [http://x-query.com/mailman/listinfo/talk]
Sent: Sunday, January 20, 2008 4:02 AM
To: 'Liam Quin'; Wei, Alice J.
Cc: http://x-query.com/mailman/listinfo/talk
Subject: RE:  Query Through Multiple Files

>
> You probably need to use an XQuery collection; however, the
> way this works varied between products, so it would depend on
> which XQuery implementation you were using.
>
> It is possible to query multiple files portably if you know
> their names

Another way of doing it that is portable is to create a document that
contains links to the documents you want to search:

<dir>
  <file>boys.xml</file>
  <file>girls.xml</file>
  <file>men.xml</file>
  <file>women.xml</file>
</dir>

then

 for $doc in /dir/file/doc(.)
 return $doc//ap/address

You wrote:

for $read in ... where distinct-values($read) return...

It's disappointing that after all the help you were given last week you
still haven't grasped that this is nonsense. The value of $read is a single
item, and passing a single item to distinct-values has no useful effect. If
you don't understand the advice you are getting, please say so and ask for
further explanation - it's a waste of everyone's time if you ignore the
advice and just keep making the same mistake.

Michael Kay
http://www.saxonica.com/



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-2007 All Rights Reserved.