Home Contents Search

introduction
introduction block Premium 5 Premium 6 Premium Domains Premium 2 Premium 3 LLLLL.com LLLLL.com 2 LLLLL.com 3 Premium 4 Rare domains cities_realestate Similar   Websites education_sites entertainment_sites games misc_sites LLLL.com Site Acronym 2 Acronym 4 Acronym 5 Acronym 6 Acronym 7 Acronym 8 Acronym 9 Acronym 10 Acronym 3 Brandable sites Pin Yin sites service_sites technology Acronym sites Payment Options About Our Office

1. Introducing BML

»1.1. Blocks

BML is essentially a simple macro language. Macros are called blocks in BML. Blocks are defined in look files and are invoked in BML files. Blocks accept parameters and are divided into several types according to how parameters are transmitted and how the definition of the block is able to make use of them. Definitions of blocks are essentially chunks of HTML with potentially more recursive BML block invocations inside them.

»

Example 1.1. BML lookup file

project=>The Alabaster Project

greeting<=
<p>Welcome to <?project project?>, a joint effort between the citizens of earth
and Spumco, Inc.</p>
<=greeting

The "project" and "greeting" constructs in the above example lookup file are blocks, and can be used to insert their respective content into HTML output. The "project" block is a single-line block that consists of everything immediately following the name of the block and the => up to the end of the line. The "greeting" block is a multiline block, and contains all the lines immediately following the greeting<= line and preceding the <=greeting one.

»1.2. BML Files

A BML file is simply an HTML file with some BML block invocations in it. Each such invocation specifies the name of the block and the parameters, if any, to pass to it. The ultimate result of a block's invocation at runtime is HTML which is put in the outgoing stream exactly at the place where the block's invocation resided in the BML file.

»

Example 1.2. BML file

<html>
  <head><title><?project project?></title>
  <body>
	<h1><?project project?></h1>

	<?greeting greeting?>
  </body>
</html>

Given the lookup file from the previous example, the BML file above would yield output like:

»

Example 1.3. Output

<html>
  <head><title>The Alabaster Project</title>
  <body>
        <h1>The Alabaster Project</h1>

        <p>Welcome to The Alabaster Project, a joint effort between the citizens of earth
and Spumco, Inc.</p>

  </body>
</html>

The block invocations in the  above do not contain parameters, but even so are still a powerful way of building a document out of aggregate parts. Adding parameters, of course, increases this usefulness.

Copyright © 2007 bmlh.com                    Powered by Engineer Partner The One Stop Outsource