autogen_back

Process AutoGen templates with XML data

Main
AutoGen
Pages

Home
Announce
FAQ
docs
XML Defs
testimonials
downloads

Automated
Options

AutoOpts
Comparison
Man example
Redistribute
Licensing
local use
using getopt

GCC's
Fixincludes

fixincludes

Automated
FSM

description
example
usagefsm

Addons
addon

Project GNU
Home Page

Automated
XDR

xdr project

i

AutoGen handles definitions in XML form by converting XML format to AutoGen Definition format. There is a small amount of information loss, as follows:

White space is stripped.
Leading and trailing white space is stripped. If there is nothing but white space, no text entry is made.

DTD's are not required
Whatever is present in the XML text will show up in the definitions.

template selection
If the top level entity has an attribute named ``template'', then you can omit the ``-T <template-name>'' option to xml2ag.

attributes
Attributes are assigned plain text values

entities
Entities always have structured values.

ordering
Ordering between differently named siblings is lost. All siblings of the same name (e.g. the two "grumbles") have ordered preserved. However, there is no ordering between the grumbles and texts within the mumbling below.

Here is a simple example of XML text:
   
<?xml version="1.0"?>
<ag_example template="sample.tpl">
  <mumble attr="foo">
    <grumble>
      &lt;stumble around the 'XML'.&gt;
    </grumble>
    mumble-1
    <!-- This is just a
         /* multi-line comment */ -->
    mumble-2
    <grumble>
      grumble &amp; "grumble" &amp; grumble.
    </grumble>
    mumble, mumble
  </mumble>
  <stumble upon="rough going"/>
</ag_example>
and the resulting output, derived by filtering the above text through: ``xml2ag -O-''
 
/* Parsed from stdin */
AutoGen Definitions sample.tpl;
XML-version = '1.0';
XML-standalone = true;
template = 'sample.tpl';
mumble = {
  content = '';
  attr = 'foo';
  grumble = {
    content = '';
    text = '<stumble around the \'XML\'.>';
  };
  text = 'mumble-1';
  /* This is just a
         /* multi-line comment * / */
  text = 'mumble-2';
  grumble = {
    content = '';
    text = 'grumble & "grumble" & grumble.';
  };
  text = 'mumble, mumble';
};
stumble = {
  content = '';
  upon = 'rough going';
};

Please direct any questions, comments, suggestions or anything else to the author, .


top  Viewable With Any Browser  Valid XHTML 1.0!


AutoGen, AutoOpts, columns, getdefs, AutoFSM, AutoXDR and these web pages copyright (c) 1999-2012 Bruce Korb, all rights reserved.

Return to GNU's home page.

Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.

Please send comments on these web pages to webmasters@www.gnu.org, send other questions to gnu@gnu.org.

This article, Copyright © 2000-2002 by Bruce Korb

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. Last modified: Sat Aug 30 11:02:04 PDT 2014