How to get the title of the thickest book from XML-file via Xquery? -


i have xml-file next structure:

<books>   <book topic="databases" ebook = "available">     <pablisher>wrox</pablisher>     <title>microsoft sql server 2008 integration services: problem, design, solution</title>     <authors>       <author>erik veerman</author>       <author>jessica m. moss</author>       <author>brian knight</author>       <author>jay hackney</author>     </authors>       <isbn>978-0-470-52576-0</isbn>       <pages>480</pages>       <publicationdate>november 2009</publicationdate>       <price>49.99</price>   </book>   </books> 

there lot of books , have return title of thickest one. thing know how find max num of pages:

max(for $x in doc("c:\xmlfile1.xml")/books/book/pages return $x) 

but next step absolutely unclear me. thank in advance.

what want take max value , find book part of

let $doc =     doc("c:\xmlfile1.xml") let $pages := max($doc/books/book/pages)  return $doc/books/book[pages = $pages] 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -