Giter Site home page Giter Site logo

yamlconv's Introduction

yamlconv
  by Chadderz

Converts between the BYAML file format and XML.

For documentation on the BYAML format see:
http://mk8.tockdom.com/wiki/BYAML_%28File_Format%29

Conversion
----------

The conversion procedure begins at the root node. It is encoded as the root
XML node with name "yaml". Every sub-node is then recursively converted.
Value nodes may either be converted to XML attributes or XML elements.
Integers are encoded directly, booleans are encoded as "true" or "false"
and floats are encoded as the numeric representation followed by an "f".
A string is encoded as the inner text of an XML element with the attribute
"type" set to "string". A path is encoded as a series of "point" elements
with attributes "x", "y", "z", "nx", "ny", "nz" and "val". The container
element of the path has attribute "type" equal to "path". Finally, arrays
are encoded as a series of "value" elements with the container having
attribute "type" equal to "array" and dictionaries are encoded as a series
of named elements or attributes.

Examples
--------

The following is an example of the output of yamlconv showing all features
mentioned above.

    <?xml version="1.0" encoding="utf-8"?>
    <yaml float_field_example="1.0f" int_field_example="0"
          bool_field_example="true">
      <string_field_example type="string">Hello!</string_field_example>
      <path_example type="path">
        <point x="0f" y="0f" z="0f" nx="0f" ny="1f" nz="0f" val="0" />
        <point x="1f" y="0f" z="0f" nx="0f" ny="1f" nz="0f" val="0" />
      </path_example>
      <array_example type="array">
        <value sample_int="0" />
        <value sample_int="1" />
      </array_example>
      <empty_array type="array" />
      <dictionary_example>
        <attr type="string">Hi!</attr>
      </dictionary_example>
      <empty_dictionary />
    </yaml>

yamlconv's People

Contributors

chadderz121 avatar zhuowei avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.