## Using GXML

by Josh Carter < josh@multipart-mixed.com >
May 10, 2001

## Welcome and Overview

Thanks for your interest in GXML. GXML is a transformation tool for XML, allowing you to process XML code in many ways. It's like XSLT in purpose, but much simpler to learn and get started with. While simpler than XSLT, GXML has features powerful enough for many tasks, comes in an easy-to-use package, and is highly extensible for special tasks.

These are GXML's high-level features:

- Template substitution for any given entity.
- Templates may be provided by user code or files on disk.
- Any part of the XML, source or template, may contain variables which will be substituted according to well-defined rules.
- Variable values may be: things embedded in an enclosing entity's start tag, other entities in scope, sub-values of an in-scope entity, or provided by user code.
- Entity tags can have variables in them.
- Special commands allow conditionals and looping, e.g. "if exists," "if equals," and "foreach."
- User can specify callbacks for start and/or end of given tags.
- Entity tags can be easily remapped to other things.
- XML syntax can be easily translated into HTML syntax.

## Running Test Files

There are several test files in the "test" directory of your GXML distribution. Change into this directory and run a couple of the .pl files. Try `variables.pl` to start, since that's the next topic I'll cover.

## Getting Down to Work

Object API: Creating and using GXML objects.

Variables: Next, dig into variable substitution in its various forms.

Templates: Templates are the power of GXML -- this is what makes it useful.

Commands: Commands are a new feature to GXML 2.0, giving it the most-needed features from XSL.

Other Features: There's lots of extra stuff you can do with GXML. This is where we pick up the scraps.

Back to GXML Home

Copyright (c) 2001-2002 Josh Carter