Introduction to ModPro

An overview of ModPro.

Overview
Prerequisites
ModPro Files
Modules
Contact

Overview

ModPro provides the ability to create web pages using modular programming principles. Modular programming makes programs easier to read, write, debug, and maintain by dividing them into managable pieces. The benefits of modular programming are:

  • It makes your code easier to write because individual modules can be independently written and tested
  • Implementation details are hidden in modules making it easier to read and maintain your code
  • Individual modules can be reused

Modular Programming Markup Language (MPML) is the name of the language used by ModPro. MPML is an XML based scripting language, like HTML or XSL.

At the most basic level MPML provides support for modules that can be defined and referenced from anywhere. It also provides an inclusion mechanism to insert the contents of one file into another file. This allows you to define module libraries and include them in multiple files.

At a more advanced level MPML provides support for creating custom modules in XSL that are used to implement some custom functionality. A collection of custom modules is called a custom module package, or ModPack. The core ModPro module package XSL file is mpml.xsl.

Prerequisites

You will need the Java Runtime Envinronment (JRE) Standard Edition version 5 or later to run ModPro. It should run on any platform that supports Java.

ModPro Files

ModPro files contain Modular Programming Markup Language. The files must be valid, well-formed XML. The root tag of a ModPro document is always <mpml>. You must specify the MPML namespace for the MPML elements. The namespace is defined as:

<mp:mpml xmlns:mp="http://www.worldtreesoftware.com/mpml">

A MPML file can contain MPML module elements and any HTML elements. Files that contain only module elements that can be included by other MPML files are known as module libraries. Files that contain an <html> element define an actual web page. The <html> element is the entry point for your web page. Everything that will be contained within a page will be defined inside that element.

Modules

Modules are sections of HTML code that can be defined and referenced from anywhere. A module is defined by a <mp:module> element and can contain any type of HTML markup or other MPML elements.

You can also define your own custom modules in XSL to do anything you want. The ModPages custom module package (aka ModPack) included with ModPro is an example. This ModPack contains custom modules for defining web page layout. If you are interested in writing your own custom modules read the tutorial and take look at modpages.xsl.

Contact

You can contact me at this page. Please report any bugs you find. Run using the -debug command line parameter and send all compiler output if possible. If you have any ideas to make ModPro better send those too. I would also like to know if you're using ModPro. Send me a link to your web site and I'll put it up on the Worldtree Software site.