|
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>
<stumble around the 'XML'.>
</grumble>
mumble-1
<!-- This is just a
/* multi-line comment */ -->
mumble-2
<grumble>
grumble & "grumble" & 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, .
|