@node xml2ag Invocation
@section Invoking xml2ag
@pindex xml2ag
@cindex XML to AutoGen Definiton Converter
@ignore
#  -*- buffer-read-only: t -*- vi: set ro:
#
# DO NOT EDIT THIS FILE   (invoke-xml2ag.texi)
#
# It has been AutoGen-ed
# From the definitions    ./xmlopts.def
# and the template file   agtexi-cmd
@end ignore

This program will convert any arbitrary XML file into equivalent
AutoGen definitions, and invoke AutoGen.
The template used will be derived from either:
@itemize @bullet
@item
The @strong{--override-tpl} command line option
@item
A top level XML attribute named, "@code{template}"
@end itemize
@noindent
One or the other @strong{must} be provided, or the program will
exit with a failure message.

The @emph{base-name} for the output will similarly be either:
@itemize @bullet
@item
The @strong{--base-name} command line option.
@item
The base name of the @file{.xml} file.
@end itemize

The definitions derived from XML generally have an extra layer
of definition.  Specifically, this XML input:
@example
<mumble attr="foo">
  mumble-1
  <grumble>
  grumble, grumble, grumble.
</grumble>mumble, mumble
</mumble>
@end example
Will get converted into this:
@example
mumble = @{
  grumble = @{
    text = 'grumble, grumble, grumble';
  @};
  text = 'mumble-1';
  text = 'mumble, mumble';
@};
@end example
Please notice that some information is lost.  AutoGen cannot tell that
"grumble" used to lie between the mumble texts.  Also please note that
you cannot assign:
@example
grumble = 'grumble, grumble, grumble.';
@end example
because if another "grumble" has an attribute or multiple texts,
it becomes impossible to have the definitions be the same type
(compound or text values).

This section was generated by @strong{AutoGen},
using the @code{agtexi-cmd} template and the option descriptions for the @code{xml2ag} program.
This software is released under the GNU General Public License, version 3 or later.

@menu
* xml2ag usage::                  xml2ag help/usage (@option{--help})
* xml2ag the-xml2ag-option::      the-xml2ag-option options
* xml2ag autogen-options::        autogen-options options
* xml2ag exit status::            exit status
@end menu

@node xml2ag usage
@subsection xml2ag help/usage (@option{--help})
@cindex xml2ag help

This is the automatically generated usage text for xml2ag.

The text printed is the same whether selected with the @code{help} option
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
the usage text by passing it through a pager program.
@code{more-help} is disabled on platforms without a working
@code{fork(2)} function.  The @code{PAGER} environment variable is
used to select the program, defaulting to @file{more}.  Both will exit
with a status code of 0.

@exampleindent 0
@example
xml2ag (GNU AutoGen) - XML to AutoGen Definiton Converter - Ver. 5.18.12
Usage:  xml2ag [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ <def-file> ]

All other options are derived from autogen:

  Flg Arg Option-Name    Description
   -O Str output         Output file in lieu of AutoGen processing

All other options:

  Flg Arg Option-Name    Description
   -L Str templ-dirs     Search for templates in DIR
                                - may appear multiple times
   -T Str override-tpl   Use TPL-FILE for the template
      Str definitions    Read definitions from FILE
      Str shell          name or path name of shell to use
   -m no  no-fmemopen    Do not use in-mem streams
      Str equate         characters considered equivalent
   -b Str base-name      Specify NAME as the base name for output
      no  source-time    set mod times to latest source
      no  writable       Allow output files to be writable
                                - disabled as '--not-writable'
      Num loop-limit     Limit on increment loops
                                - is scalable with a suffix: k/K/m/M/g/G/t/T
                                - it must lie in one of the ranges:
                                  -1 exactly, or
                                  1 to 16777216
   -t Num timeout        Limit server shell operations to SECONDS
                                - it must be in the range:
                                  0 to 3600
      KWd trace          tracing level of detail
      Str trace-out      tracing output file or filter
      no  show-defs      Show the definition tree
      no  used-defines   Show the definitions used
   -C no  core           Leave a core dump on a failure exit
   -s Str skip-suffix    Skip the file with this SUFFIX
                                - prohibits the option 'select-suffix'
                                - may appear multiple times
   -o Str select-suffix  specify this output suffix
                                - may appear multiple times
   -D Str define         name to add to definition list
                                - may appear multiple times
   -U Str undefine       definition list removal pattern
                                - an alternate for 'define'
   -M opt make-dep       emit make dependency file
                                - may appear multiple times

Version, usage and configuration options:

  Flg Arg Option-Name    Description
   -v opt version        output version information and exit
   -? no  help           display extended usage information and exit
   -! no  more-help      extended usage information passed thru pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
This program will convert any arbitrary XML file into equivalent AutoGen
definitions, and invoke AutoGen.

The valid "trace" option keywords are:
  nothing       debug-message server-shell  templates     block-macros
  expressions   everything
  or an integer from 0 through 6
The template will be derived from either: * the ``--override-tpl'' command
line option * a top level XML attribute named, "template"

The ``base-name'' for the output will similarly be either: * the
``--base-name'' command line option * the base name of the .xml file
Packaged by Bruce (2016-08-29)
Report xml2ag bugs to bkorb@@gnu.org
@end example
@exampleindent 4

@node xml2ag the-xml2ag-option
@subsection the-xml2ag-option options
All other options are derived from autogen.
@subsubheading output option (-O).
@anchor{xml2ag output}
@cindex xml2ag-output

This is the ``output file in lieu of autogen processing'' option.
This option takes a string argument @file{file}.
By default, the output is handed to an AutoGen for processing.
However, you may save the definitions to a file instead.
@node xml2ag autogen-options
@subsection autogen-options options
All other options.
These options are @i{mostly} just passed throug to @code{autogen}.
The one exception is @code{--override-tpl} which replaces the
default template in the output definitions.  It does not get passed
through on the command line.
@subsubheading templ-dirs option (-L).
@anchor{xml2ag templ-dirs}
@cindex xml2ag-templ-dirs

This is the ``search for templates in @file{dir}'' option.
This option takes a string argument @file{DIR}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading override-tpl option (-T).
@anchor{xml2ag override-tpl}
@cindex xml2ag-override-tpl

This is the ``use @file{tpl-file} for the template'' option.
This option takes a string argument @file{TPL-FILE}.
Pass-through AutoGen argument
@subsubheading lib-template option (-l).
@anchor{xml2ag lib-template}
@cindex xml2ag-lib-template

This is the ``load autogen macros from @file{tpl-file}'' option.
This option takes a string argument @file{TPL-FILE}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument

@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
@subsubheading definitions option.
@anchor{xml2ag definitions}
@cindex xml2ag-definitions

This is the ``read definitions from @file{file}'' option.
This option takes a string argument @file{FILE}.
Pass-through AutoGen argument
@subsubheading shell option.
@anchor{xml2ag shell}
@cindex xml2ag-shell

This is the ``name or path name of shell to use'' option.
This option takes a string argument @file{shell}.
Pass-through AutoGen argument
@subsubheading no-fmemopen option (-m).
@anchor{xml2ag no-fmemopen}
@cindex xml2ag-no-fmemopen

This is the ``do not use in-mem streams'' option.
Pass-through AutoGen argument
@subsubheading equate option.
@anchor{xml2ag equate}
@cindex xml2ag-equate

This is the ``characters considered equivalent'' option.
This option takes a string argument @file{char-list}.
Pass-through AutoGen argument
@subsubheading base-name option (-b).
@anchor{xml2ag base-name}
@cindex xml2ag-base-name

This is the ``specify @code{name} as the base name for output'' option.
This option takes a string argument @file{NAME}.
Pass-through AutoGen argument
@subsubheading source-time option.
@anchor{xml2ag source-time}
@cindex xml2ag-source-time

This is the ``set mod times to latest source'' option.
Pass-through AutoGen argument
@subsubheading writable option.
@anchor{xml2ag writable}
@cindex xml2ag-writable

This is the ``allow output files to be writable'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
can be disabled with --not-writable.
@end itemize

Pass-through AutoGen argument
@subsubheading loop-limit option.
@anchor{xml2ag loop-limit}
@cindex xml2ag-loop-limit

This is the ``limit on increment loops'' option.
This option takes a number argument @file{lim}.
Pass-through AutoGen argument
@subsubheading timeout option (-t).
@anchor{xml2ag timeout}
@cindex xml2ag-timeout

This is the ``limit server shell operations to @code{seconds}'' option.
This option takes a number argument @file{SECONDS}.
Pass-through AutoGen argument
@subsubheading trace option.
@anchor{xml2ag trace}
@cindex xml2ag-trace

This is the ``tracing level of detail'' option.
This option takes a keyword argument @file{level}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
This option takes a keyword as its argument.
The argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_TRACE).
The available keywords are:
@example
    nothing       debug-message server-shell
    templates     block-macros  expressions
    everything
@end example

or their numeric equivalent.@end itemize

Pass-through AutoGen argument
@subsubheading trace-out option.
@anchor{xml2ag trace-out}
@cindex xml2ag-trace-out

This is the ``tracing output file or filter'' option.
This option takes a string argument @file{file}.
Pass-through AutoGen argument
@subsubheading show-defs option.
@anchor{xml2ag show-defs}
@cindex xml2ag-show-defs

This is the ``show the definition tree'' option.
Pass-through AutoGen argument
@subsubheading used-defines option.
@anchor{xml2ag used-defines}
@cindex xml2ag-used-defines

This is the ``show the definitions used'' option.
Pass-through AutoGen argument
@subsubheading core option (-C).
@anchor{xml2ag core}
@cindex xml2ag-core

This is the ``leave a core dump on a failure exit'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{HAVE_SYS_RESOURCE_H} during the compilation.
@end itemize

Many systems default to a zero sized core limit.  If the system
has the sys/resource.h header and if this option is supplied,
then in the failure exit path, autogen will attempt to set the
soft core limit to whatever the hard core limit is.  If that
does not work, then an administrator must raise the hard core
size limit.
@subsubheading skip-suffix option (-s).
@anchor{xml2ag skip-suffix}
@cindex xml2ag-skip-suffix

This is the ``skip the file with this @file{suffix}'' option.
This option takes a string argument @file{SUFFIX}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@item
must not appear in combination with any of the following options:
select-suffix.
@end itemize

Pass-through AutoGen argument
@subsubheading select-suffix option (-o).
@anchor{xml2ag select-suffix}
@cindex xml2ag-select-suffix

This is the ``specify this output suffix'' option.
This option takes a string argument @file{SUFFIX}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading define option (-D).
@anchor{xml2ag define}
@cindex xml2ag-define

This is the ``name to add to definition list'' option.
This option takes a string argument @file{value}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading undefine option (-U).
@anchor{xml2ag undefine}
@cindex xml2ag-undefine

This is the ``definition list removal pattern'' option.
This option takes a string argument @file{name-pat}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading make-dep option (-M).
@anchor{xml2ag make-dep}
@cindex xml2ag-make-dep

This is the ``emit make dependency file'' option.
This option takes an optional string argument @file{type}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@node xml2ag exit status
@subsection xml2ag exit status

One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid.
@end table
