define function conFun($n as xs:string) as xs:string{
let $res:=concat($n,"one dream !")
return $res
}
let $chart:=" one world "
return conFun($chart)
define function testFun($name as xs:string) as xs:string*{
for $b in doc($name)/bib/book
where $b/publisher = "Addison-Wesley" and $b/@year > 1991
return data ($b/title)
}
let $n :="http://www.bn.com/bib.xml"
return testFun($n)
涓.娉ㄦ剰鏈塧s 濡傛灉鏈夊琛屽兼湁sring*.
define function testFun($name as xs:string) as node()*{
for $b in doc($name)/bib/book
where $b/publisher = "Addison-Wesley" and $b/@year > 1991
return
<book year="{ $b/@year }">
{ $b/title }
</book>
}
let $n :="http://www.bn.com/bib.xml"
return testFun($n)
涓嶅甫鍙傛暟鐨勬儏褰?br />
define function testFunBook() as xs:string*{
for $b in doc("http://www.bn.com/bib.xml")/bib/book
where $b/publisher = "Addison-Wesley" and $b/@year > 1991
return $b/title
}
let $a:= testFunBook()
return $a
5.榛樿鍛藉悕絀洪棿鐨勯棶棰?br />
6.鍒犻櫎鏂囨。
xdmp:document-delete("books.xml")