aterm2xml — translates an ATerm to XML
file | --input
file | --input
[-S | --silent]
level | --keep
[-h | -? | --help]
The aterm2xml utility is used to convert an ATerm to a corresponding XML. The ATerm and XML languages are slightly different, so there is a tradeoff between how "natural" the result of the conversion feels and how faithfully it can be converted back into XML.
Since applications have different needs, there are three conversion modes available: implicit, explicit, and very explicit.
The explicit mode is the default mode and supports a roundtrip for almost all ATerms. This means that an ATerm can be converted to XML and back without changing its structure.
The implicit mode does not support such a roundtrip, but the XML is usually more attractive. Use this mode if you only want to export some ATerm to an XML application. The name 'implicit' is related to the more implicit structure in the resulting XML.
The very explicit mode supports a roundtrip for all ATerms. This mode is the way to go if you need the guarantee that a roundtrip preserves the structure of all your ATerms.
The structure of the XML documents in the very explicit mode is generic: there are no language specific elements in these XML documents. The structure is described as a RELAX NG schema.
XML Processing Options
Do conversion in explicit mode. This is the default. See below for details.
Do conversion in very explicit mode. See below for details.
Do conversion in implicit mode. See below for details.
Common Input/Output Options
The input term given by the file name
In the absence of the
-i option, input
will be read from
The output will be written to the file given by the file name
In the absence of the
output will be written to
The output will be written in the binary (BAF) ATerm format.
ATerms in the BAF format require a lot less space than ones in the TAF format, but the Java ATerm library does not currently support baf ATerms. ATerms in the baf format is the preferred format of exchange between Stratego tools.
Common Debugging Options
Display usage information.
Keep intermediate results produced by the internal stages in the
pretty-printing process. This is only useful for debugging. A high
int indicates increased eagerness
for keeping intermediate results.
Default setting is 0, indicating that no intermediates will be kept.
Silent execution. Same as
Set verbosity level to numerical value
higher the number, the more information about pp-aterm's inner workings are
int can be set to either of the
following verbosity levels, given in increasing order of verbosity:
Displays the tool name and version.
The following will convert the term A(, "b") to its implicit XML representation:
$echo "A(, \"b\")" | aterm2xml --implicit
<?xml version="1.0" ?> <A xmlns:at="http://aterm.org">1b</A>
The following will convert the term A(, "b") to its explicit XML representation:
$echo "A(, \"b\")" | aterm2xml --explicit
<?xml version="1.0" ?> <A xmlns:at="http://aterm.org"><at:list><at:int>1</at:int></at:list><at:string>b</at:string></A>
The following will convert the term A(, "b") to its very explicit XML representation:
$echo "A(, \"b\")" | aterm2xml --very-explicit
<?xml version="1.0" ?> <at:appl xmlns:at="http://aterm.org" at:fun="A"><at:list><at:int><at:value>1</at:value></at:int></at:list><at:string><at:value>b</at:value></at:string></at:appl>
See xml2aterm for more examples.
Please report bugs to
Copyright (C) 2002-2005 Eelco Visser
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.