Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Thanked 0 Times in 0 Posts

    Constructing queries in XQuery on the basis a DTD

    Ok i have been recently studying xpath but im a bit stumped on xquery.When writing queries do you write them in the same way as xpath or is it different?

    I have been trying to answer these sample questions but have had no luck.
    The question is:

    The following DTD defines bibliographic information.
    <!ELEMENT bib  (book* )>
    <!ELEMENT book  (title,  (author+ | editor+ ), publisher, price )>
    <!ATTLIST book  year CDATA  #REQUIRED >
    <!ELEMENT author  (last, first )>
    <!ELEMENT editor  (last, first, affiliation )>
    <!ELEMENT title  (#PCDATA )>
    <!ELEMENT last  (#PCDATA )>
    <!ELEMENT first  (#PCDATA )>
    <!ELEMENT affiliation  (#PCDATA )>
    <!ELEMENT publisher  (#PCDATA )>
    <!ELEMENT price  (#PCDATA )>
    Construct the following queries in XQuery on the basis of the above DTD:

    Find all authors who have authored a book and an article in the same year.?

    This was what i was given on the question and im stumped.
    Can any one give me the answers/tips/hits on how to answer these.I think i just need the answer to one of them just to see what i should be doing.

    Thanks in advance
    Last edited by mattys1; 11-18-2008 at 04:14 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts