Hero,把XML模式转换为JSON模式

Hero is a hexo-based command line tool that use xsd2json to generate json schema from xml schema files.

Prerequisite

You need to install swi-prolog

Workflow

  1. you need to create a empty directory, and run the following command to initialize it in the created directory.

    1
    $ mkdir hero-test && cd hero-test
    $ hero init
    [info] Copying data
    [info] You are almost done! Don't forget to run `npm install` before you start!
  2. install dependency packages

    1
    $ npm install
    npm http GET https://registry.npmjs.org/interpreted
    npm http GET https://registry.npmjs.org/nomnom
    npm http GET https://registry.npmjs.org/async
    ....
  3. place your xsd files to xsd directory, and run hero schema to generate json schema files in json directory.

    1
    $ hero schema
    [info] Generating json schema ...
    [info] Json schema models generated.