|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] XPath Issues in XQueryWei, Alice J. ajwei at indiana.eduSat Feb 16 06:34:04 PST 2008
Hi, XQueriers: I have an XQuery as in the following: let $ad := fn:collection("xmldb:exist://db/cbml") let $volume := $ad//seriesStmt/idno[@type='volume'][1] let $issue := $ad//seriesStmt/idno[@type='issue'][1] let $journal := $ad//seriesStmt/title[@level='journal'][1] let $ad2 := $ad//ad/head[contains(., 'muscle') or contains(., upper-case('muscle'))] let $sorted_result:= for $doc in distinct-values($ad2) order by $doc return $doc for $r at $count in $sorted_result let $nodes := $ad2[. = $r][1] return <ad> <statistics> Showing Result: {$count} / {count($sorted_result)} </statistics> <source> <journal>{data($journal)}</journal> <publication_information>Volume {data($volume)[1]}, Issue {data($issue)}</publication_information> </source> {$nodes} </ad> Right now, I have a sample entry as in the following: <ad> <statistics> Showing Result: 1 / 2</statistics> <source> <journal>My Journal My Journal My Journal My Journal My Journal My Journal My Journal My Journal </journal> <publication_information>Volume 1 , Issue 2 4 1 3 5 6 7 </publication_information> </source> <head rend ="bgblack"> <emph rend ="red">FREE MUSCLE Secrets</emph> </head> </ad> What I want: <ad> <statistics> Showing Result: 1 / 2</statistics> <source> <journal>My Journal</journal> <publication_information>Volume 1 , Issue 1</publication_information> </source> <head rend ="bgblack"> <emph rend ="red">FREE MUSCLE Secrets</emph> </head> </ad> How much would I have to adjust my XPath expression to return something like above? Any help is appreciated. ====================================================== Alice Wei MIS 2008 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






