                   Convert XML to and from YAML
                   ============================


===========
Description
===========

This mini-package contains two implementations of conversion
routines that convert XML to YAML and YAML to XML.  These two
implementations use different canonical representations for XML in
YAML as follows:

convertyaml_map.py uses the following representation:

    The canonical YAML representation of an XML element is a
    dictionary (mapping) containing the following key/value pairs:
        (1) "name" (required) -- a string.
        (2) "attributes" (optional) -- a dictionary (mapping) of name/value
            pairs.
        (3) "text" (optional) -- a string.
        (4) "children" (optional) -- a sequence of dictionaries (mappings).

convertyaml_seq.py uses the following representation:

    The canonical YAML representation of an XML element is a 4-tuple
    (a sequence) containing the following:
        (1) element name
        (2) attributes -- a mapping
        (3) text -- a string
        (4) children -- a sequence of elements

Basically, convertyaml_map.py uses keywords (in a dictionary) to
represent structures and convertyaml_seq.py uses position (within a
list).

=====
Usage
=====

There is some usage information at the top of each implementation
file.


=======
Testing
=======

Here are some simple tests:

    python convertyaml_map.py -x2y people.xml
    python convertyaml_map.py -x2y people.xml > people.yml
    python convertyaml_map.py -y2x people.yml

    python convertyaml_seq.py -x2y people.xml
    python convertyaml_seq.py -x2y people.xml > people.yml
    python convertyaml_seq.py -y2x people.yml


======================
Additional Information
======================

The YAML home site is at:

    http://www.yaml.org/





Dave Kuhlman
dkuhlman@rexx.com
http://www.rexx.com/~dkuhlman


