An open API service indexing awesome lists of open source software.

https://github.com/pixelbyaj/react-xsd-tree

Convert XSD to Tree View
https://github.com/pixelbyaj/react-xsd-tree

Last synced: about 1 month ago
JSON representation

Convert XSD to Tree View

Awesome Lists containing this project

README

        

# ReactXsdTree

This form is used to design React Material Tree using any given XSD/ISO 20022 Json object. .

![npm](https://img.shields.io/npm/v/react-xsd-tree)
![NPM](https://img.shields.io/npm/l/react-xsd-tree)
[![npm](https://img.shields.io/npm/dm/react-xsd-tree)](https://npmjs.org/package/react-xsd-tree)

## [DEMO](https://stackblitz.com/edit/reactxsdtree?file=README.md)

## Features

- 🔥 Automatic tree generation from the given XSD Json
- ⚡️ Supports ISO 20022 messages:

## How to consume

1. Install npm package ngx-xml-message.

```console
npm i react-xsd-tree
```

```tsx
import React from "react";
import { camt53 } from "./models/model"; // model
import ReactXsdTree from "./components/ReactXsdTree";
import { ReactXsdTree, SchemaElement, useReactXsdTreeViewApiRef } from "react-xsd-tree";

const App: React.FC = () => {
const reactXsdTreeApiRef = useReactXsdTreeViewApiRef();

const onSelect = (event, item: SchemaElement) => {
console.log(item);
};

const handleClick = (event) => {
reactXsdTreeApiRef.current?.selectItem(
event,
"document_bktocstmrstmt_grphdr_credttm"
);
};
return (
<>
Click Me


>
);
};

export default App;

```

## Convert XSD to JSON

1. Install npm package xsd-json-converter.

```console
npm i xsd-json-converter
```

## How to Use

```console
xjc
```

### Example
#### Linux

```console
xjc /mnt/c/source/xsd/camt.053.001.10.xsd /mnt/c/source/xsd/camt.053.json
```

#### Windows
```console
xjc C:/source/xsd/camt.053.001.10.xsd C:/source/xsd/camt.053.json
```