This article explains the tags, syntax, and format of GRML 2.0 (General Reuse Markup Language), a data defintion markup language. This contrasts HTML, PDF, or other display-oriented formats or markup languages. GRML is similar to the CSV format or XML, because it focuses on content structure, rather than content display.
Web browsing is possible with GRML because it uses ASCII text, the same as HTML. Just as there are web browsers for HTML, the same is true for GRML. Both use web servers, text, images, and hyperlinks. They both use static and dynamic web pages. Both support ASP, .NET, CGI, PHP, or JSP. They both use the web, but in different ways.
Background.
Before using GRML, it is important to know how it differs from other formats and markup languages. Introducing GRML describes the circumstances for creating the markup langauge and covers its strengths and weaknesses. It is recommended to read it first.
To understand its history, read Understanding GRML. It describes the path taken to arrive at GRML 2.0. It sets the timeframe and requirements for developing the latest version of the markup language.
Getting Started.
First, it is important to understand what GRML is and what it is not.
GRML is not for:
unstructured data (e.g., articles, stories, letters);
GRML is for:
structured data (e.g. databases, spreadsheets, or character-delimited files);
web data (e.g. search engines, news headlines, auction listings, etc.);
dimensional data (e.g. forecasting, modeling, time series, etc.);
links (files);
hyperlinks (web pages); and,
images.
Knowing the type of content GRML handles, the next step is to examine the tags used to create input controls, columns, and results.
Tag types.
GRML uses form tags and view tags. The form tags create the input controls in a viewer (viewers display content from GRML files or web pages). The view tags create columns and results.
Every tag supports a name. For form tags, the name is used to associate a value to the input control when sending a request. When it is a view tag, the name is used to create a dimension (i.e. group) of columns and results. While a name is required for form tags, it is optional for view tags.
When GRML reads a line, the tag is read first. All tags use a parent-child relationship to specify values. The parent tag defines the type of tag, whether input control, column or result. Each child tag sets the attributes. Parent tags have closing tags and may use a name. Child tags do not have closing tags and do not use a name.
All tags reside on one line. Once the end of the line is reached, the next tag is read. Once a parent tag is read, everything else on that line is ignored. Child tags are read using an <attribute>value pair. Once the carriage-return or line-feed is reached, the attribute value is set and the next tag is read.
The above GRML creates an edit input control with a name of url1. It has a title of Enter URL: and it displays http://127.0.0.1 in its input area. The parent tag is <editurl1> and the child tags are <title> and <text>.
There are other input controls using form tags, such as combo boxes, list boxes, calendar controls, spin controls, or radio buttons. They all follow the same pattern.
A form tag is used to add a submit button input control. Without it, there is no way to send a form request. Submit has a location attribute, which determines where the form values are sent. In this case, the request is sent to GRMLBrowser.com/webpages/rss.asp. Notice, there are no end tags for any of the <attribute>value pairs.
These are some form tags supported by Pioneer Report MDI.
<editname> Parent
<text> (sets the input value)
<title> (sets the label)
</edit>
<submit> <location> (sets the form destination)
<text> (sets the button text)
<title> (sets the label)
</submit>
<dimension> <name> (not covered in this article)
</dimension>
These tags and <attribute>value pairs are form tags. The next step is to create columns and results, with view tags.
View tags.
There are two types of view parent tags, column and result. Each supports a name, when using dimensions. Since dimensions are not covered here, only tags without a name are discussed.
When creating columns in GRML, a column order is defined. The column order is the order of <attribute>value pairs using the column parent tag. It is called a column order because a viewer displays each column in descending order as it appears in the column parent tag.
Two columns are created using view tags. The first column is MyFirstColumn. The second is Another column. No results are shown because none have been added. To add results, using the column order above, the result parent tag is used.
A result has been added, containing two result items, using view tags. MyFirstColumn has the value Hello, world.. Another column has the value This works!.
With an understanding of the different tags used in GRML, it is now possible to understand what is happening in a GRML file or web page. The next section presents more ways to create input controls, columns, and results using form and view tags.
07/11/05. Split into 3 web pages.
01/08/05. Updated formatting.
10/26/04. Removed almost all references to Pioneer Report MDI.
10/26/04. Added article text to cover GRML tags.
10/26/04. Updated examples from GRML 1.2 to GRML 2.0.
08/30/04. First published.