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

Using Every Clause?

Wei, Alice J. ajwei at indiana.edu
Wed Apr 16 11:14:06 PDT 2008


  Using Every Clause?
Hi, XQueriers:

  I have a query as follows:

  declare function local:searchresult($seq as element()*) as element()*
{
let  $sorted_result:=
        for $doc in distinct-values($seq)
        order by $doc
        return $doc
return
for $d at $count in $sorted_result
let $head := $seq[.=$d][1]/ancestor::ad/child::head
let $para := $seq[.=$d][1]/ancestor::ad/(descendant::div|descendant::p)
return
<div>
<p>Showing Result: <b>{$count} / {count($sorted_result)}</b></p>
<p style="font-weight:bold">{$head}&#160; {$head2}&#160; {$head3}</p>
{$para}
</div>
};
let $a := collection("mycollection")//my//head[contains(upper-case(.),'MARKET')]
return
local:searchresult($a)

Functionally, this query works but I don't want the way it gives me the way it presents the HTML output. This initially is not a problem with the XML output format.
Is it possible that I could do something like:

<div>
<p style="font-weight:bold">
<head>Market Place</head>
    </p>
<p>for rates write to Classified, 100 E. Ohio Chi</p>
<div>
<p style="font-style:bold">Vitamins</p>
<p style="font-weight:bold">Discount Vitamins. </p>
<p> "E" 400 I.U. 100--$1.98.   Free catalog. </p>
</div>
<!----more ads-->
</div>

using the input below:

<ad>
<p style="font-weight:bold">
<head>Market Place</head>
    </p>
<p>for rates write to Classified, 100 E. Ohio Chi</p>
<div>
        <head>
<emph rend="bold">Vitamins</emph>
</head>
        <list>
        <item>
<emph rend="bold">Discount Vitamins.</emph>
 "E" 400 I.U. 100--$1.98.   Free catalog.  </item>
</list>
</div>
</ad>

instead of having all the description at the end of the query output?

Thanks to those who can help.

Aliceeeeeeeeeeeeeeeeee
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
http://x-query.com/mailman/listinfo/talk



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.