4.2.2.1 Note: A question of flexibility
The main issue, which informed the design of multishop.php, is that almost anything can
be encoded in the HTTP query string passed into it. Unlike a typical HTTP form into
PHP scenario, such as in the case of queries.php above, the search parameters cannot be
predefined.
This is because we need to be able to describe and search for an infinite number of
different products and services, which can be described in an infinite number of different
ways. For example, a computer shop`s inventory and description thereof differs radically
from an art gallery`s, or a butcher`s or a bookshop`s. A typical item in a computer shop
might be:
DESCRIPTION:mouse; MAKE:Samsung; MODEL:SM937 Optical; PRICE:24.99.
A pet shop, whereas, describes its mice in a completely different way:
DESCRIPTION:mouse; GENUS SPECIES: Mus musculus ; NAME: Mickey;
COLOUR:white; PRICE 24.99.
Creating set categories for every type of product and service on sale in the country would
be completely impractical, so it was decided instead to make the system as flexible as
possible. Critically, this rules out the use of DTDs, something which would seem to
negate a basic rule of XML, namely that all documents be strictly structured. As
explained above, however, it would be nigh on impossible to define and formalise all of
the tags and permitted attribute values for every possible item that the system is likely to
come across.
37