Code Monkey home page Code Monkey logo

xsd2go's Introduction

XSD2Go - Automatically generate golang xml parser based on XSD

Build CI Lint CI Go Report Card 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.

Related projects:

  • 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 \
    --xmlns-override=http://cpe.mitre.org/language/2.0=cpe_language \
    .scap_schemas/schemas/xccdf/1.2/xccdf_1.2.xsd \
    github.com/gocomply/scap pkg/scap/models

Installation

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

xsd2go's People

Contributors

isimluk avatar dependabot[bot] avatar grzn avatar vvidovic-croz avatar elahmo avatar iceflowre avatar jj1bdx avatar npalumbo avatar vany 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.