Here we present a use case of XML and DTD: the XMark benchmark. XMark is a benchmark for XML data management. It consists of a scalable XML document database modelling an Internet auction website and a concise and comprehensive set of XQuery queries with a natural interpretation with respect to the auction database.
In this chapter, we are interested to the XMark XML documents and the corrensponding DTD. We will query these documents in chapters about XPath and XQuery.
XMark documents model an Internet auction website. The auction website contains items that belong to different geographical regions and are separated into different cathegories, and people that bids for these items. People are watching open auctions, which are mainly defined by an item, a seller, and a list of bidders. Closed auctions are mainly defined by an item, a seller, a buyer and a price. XMark documents are hybrid documents: they contain both data-oriented and text-oriented fragments. The XMark DTD (document, image) is an instructive example of DTD, containing several relationships modelled with ID and IDREF attributes.
XMark documents can be generated with a command line tool that you can downloaded from the XMark website. The relevant options for the generator are: -f factor to generate a document with a given scaling factor. The scaling factor influences the size of the document. In particular, a scaling factor equal to 1 maps to a document of about 100 MB and the document size scales linearly with respect to the scaling factor. The option -d includes the DTD declaration in the generated document, and -o file stores the resulting document in file. Here is an XMark document of about 100 KB.