Click to See Complete Forum and Search --> : XML XQuery


jpoltora
05-13-2004, 06:04 AM
Hi,
I'm very new to XQuery and need help.
I have xml document
eg
<catalog>
<author>
<name>
Tom Brown
</name>
<book>
example
</book>
<book>
example2
</book>
</author>
<author>
<name>
John Smith
</name>
<book>
example3
</book>
<book>
example4
</book>
</author>
<author>
<name>
Tom Brown
</name>
<book>
test
</book>
<book>
test2
</book>
</author>

</catalog>

So I have multiple author in catalog and need to create new xml documentwhich will show each author and total number of books publish.
eg
<author>
<name>
John Smith
</name>
<number of books> 2 </number of books>
</author>
<author>
<name>
Tom Broun
</name>
<number of books> 4 </number of books>
</author>

How do I make XQuery.

Any help will apreciate

John

Khalid Ali
05-13-2004, 09:31 PM
I have put together some code for you,take a look

XML + XSL (http://68.145.77.180/skills/javascripts/xmlstuff/AuthorCatlogue.xml)