how irun xquery in backgrorund using xml file

Posted by Malikvnit under DotNetFunda.Com on 4/14/2012 | Points: 10 | Views : 1068 | Status : [Member] | Replies : 0
hi sir,
sir what i want to do, first i made a GUI which contain one text box and one button ok
the string written in text box is passed it to my xquery in back ground. and sir the xquery is using one xml file which is input
file for xquery.
when i click the button the xquery run in back ground and give the result.
sir we all thing doing using with the help of GUI only.
not want to run the xquery manually it run automaically in background whaen i click the button.

my input xml file:=
<transactions>
<transaction id="1">
<name>oracle</name>
<meta>
<metadata>a</metadata>
<metadata>b</metadata>
<metadata>x</metadata>
<metadata>y</metadata>
<metadata>s</metadata>
<metadata>t</metadata>
<metadata>u</metadata>
<metadata>v</metadata>
<metadata>x y</metadata>
<metadata>s t u v</metadata>
</meta>
</transaction>
<transaction id = "2">
<name>google</name>
<meta>
<metadata>a</metadata>
<metadata>t</metadata>
<metadata>u</metadata>
<metadata>v</metadata>
<metadata>s</metadata>
<metadata>x</metadata>
<metadata>r</metadata>
<metadata>t u v</metadata>
<metadata>s x r</metadata>
</meta>
</transaction>
</transactions>

my xquery :=declare variable $xfile:="meta.xml";

(: declare variable $search:="a"; :)
(: declare variable $search:="b"; :)
(: declare variable $search:="b x"; :)
(: declare variable $search:="p q w r"; :)
(: declare variable $search:="t u v"; :)
declare variable $search:="s r b";

declare function local:pgp_4($seq as item()*) as item()*
{
let $len := fn:count($seq)
for $i in (1 to $len)
return
(
$seq[$i],
(
for $j in (xs:int($i+1) to $len)
return
(
fn:concat($seq[$i],' ',$seq[$j]),
(
for $k in (xs:int($j+1) to $len)
return
(
fn:concat($seq[$i],' ',$seq[$j],' ',$seq[$k]),
(
for $m in (xs:int($k+1) to $len)
return
(
fn:concat($seq[$i],' ',$seq[$j],' ',$seq[$k],' ',$seq[$m])
)
)
)
)
)
)
)
};

<output> {
let $auction := doc($xfile)
let $seq:=tokenize($search,' ')
let $seq_pgp_4:=local:pgp_4($seq)
for $i in $auction/transactions/transaction
where ($i/meta/metadata) = $seq_pgp_4
return
<find>{$i/name/text()}</find>
}
</output>

plz sir give me suggestion is it possile that i want
and if it possible than how i do plz help me sir give suggestion

plz sir tell me how i do how the coding part work for that sir plzzzzz
i m new in plz help me

thanks in advance




Responses

(No response found.)

Login to post response