NetBlazon
About Us Our Services Our Products Our Clients Contact Us

Miva Merchant and Doctypes

Miva Merchant's standard output doesn't include a doctype specification, and due to the architecture, there is no way for a module to provide the ability to specify a doctype. Instead, one must use the following mechanism that was originally proposed by Tom Smith of www.tomcats.net. (And Tom, in deference to you, we can't help but add that this kind of "tomfoolery" isn't necessary in Miva Merchant 5!)

4.x versions of Miva Merchant have two files named "merchant.mvc". One resides in the Merchant2 directory, and one in a directory of the same name as the version of Miva Merchant being run. For instance, if you are running Miva Merchant 4.24, then under Merchant2 there is a folder named "4.24", and there is another file in that directory named "merchant.mvc", which is the file that outputs the opening <html> tag.

Merchant2/merchant.mvc is simply a stub file that calls 4.xx/merchant.mvc. Therefore, we can replace the stub file with one that outputs the doctype prior to calling 4.xx/merchant.mvc.

The following matrix is a list of downloadable replacement merchant.mvc stub files. Rename your original merchant.mvc file, and drop this into your Merchant2 directory instead.

Each zip file contains replacement merchant.mvc scripts for the following doctypes.

  • HTML 4.01 Loose
  • HTML 4.01 Strict
  • XML 1.0 Strict (no xml tag with encoding)
  • XML 1.0 Transitional (no xml tag with encoding)
  • XML 1.0 Strict (xml tag with utf-8 encoding)
  • XML 1.0 Transitional (xml tag with utf-8 encoding)
  • XML 1.0 Strict (xml tag with utf-16 encoding)
  • XML 1.0 Transitional (xml tag with utf-16 encoding)
  • XML 1.0 Strict (xml tag with ISO-8859-1 encoding)
  • XML 1.0 Transitional (xml tag with ISO-8859-1 encoding)

Helpful hint: If your doctype requires a lower-case <html> tag, download the merchant.mvc file from the 4.xx directory, open it in a binary editor, and change the tag case. Unfortunately there's no known way to add the xmlns attribute to the html tag in Miva Merchant 4.