xsd2go

command module
v0.1.3-0...-d7886aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: Unlicense Imports: 1 Imported by: 0

README

XSD2Go - Automatically generate golang xml parser based on XSD Build CI Gitter PkgGoDev

You should run xsd2go, before ever importing encoding/xml to your project.

You may want to start reading blog introduction to this project.

Motivation

Did you ever got to implement XML parser? Perhaps for atom, or scap? You may have got XSD (XML Schema Definition) files to verify adherence to given xml application? Wouldn't it be cool to automatically generate XML parser based on XSD definition? That's exactly what we are up to here.

  • Metaschema - generate golang code based on NIST metaschema input
  • SCAP - parsers of NIST SCAP family of standards

Exemplary Usage

# Acquire latest some XSD file you want to convert - for instance XCCDF 1.2
git clone --depth 1 https://github.com/openscap/openscap
# Parse XSD schema and generate golang structs
./gocomply_xsd2go convert openscap/schemas/xccdf/1.2/xccdf_1.2.xsd github.com/complianceascode/librescap pkg/scap/models/xccdf/1.2

Installation

go get -u -v github.com/gocomply/xsd2go/cli/gocomply_xsd2go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
xsd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL