July 2021
The main feature of xsd2code is the ability to generate code based on various data files or schemas, but this tool can do a lot more than that.
In this short "how-to" guide we will go over the built-in conversion tool.
This system lets you convert your data and/or schema files from diverse formats into different various formats, for example :
This setting can be accessed by right clicking whichever file you wish to convert, then, in the menu, you will find the usual xsd2code++ option, hovering over it reveals the various conversion options depending on your file.
Here's what the process looks like, firstly it'll go thourgh a short conversion process, the process of which is shown by the small seen above. As soon as the conversion is finished your converted file will open.
Here's an example of a JSon schema being turned into an XSD schema :
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Generated by xsd2code++. www.xsd2code.com", "definitions": { "PurchaseOrderType": { "type": "object", "properties": { "ShipTo": { "type": "array", "items": { "$ref": "#/definitions/USAddress" }, "minItems": 1, "maxItems": 2 }, "BillTo": { "$ref": "#/definitions/USAddress" }, "OrderDate": { "type": "string" } }, "required": [ "BillTo" ] }, "USAddress": { "type": "object", "properties": { "name": { "type": "string" }, "street": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" }, "zip": { "type": "integer" }, "country": { "type": "string" } }, "required": [ "name", "street", "city", "state", "zip" ] } }, "type": "object", "additionalProperties": false, "properties": { "PurchaseOrder": { "$ref": "#/definitions/PurchaseOrderType" } } }
<?xml version="1.0"?> <xsd:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="PurchaseOrderType"> <xsd:sequence> <xsd:element minOccurs="1" maxOccurs="unbounded" name="ShipTo" type="USAddress" /> <xsd:element name="BillTo" type="USAddress" /> <xsd:element name="OrderDate" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="USAddress"> <xsd:sequence> <xsd:element name="name" type="xsd:string" /> <xsd:element name="street" type="xsd:string" /> <xsd:element name="city" type="xsd:string" /> <xsd:element name="state" type="xsd:string" /> <xsd:element name="zip" type="xsd:int" /> <xsd:element name="country" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:element name="RootSchemaCustomers"> <xsd:complexType> <xsd:sequence> <xsd:element name="PurchaseOrder" type="PurchaseOrderType" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
Go ahead and try this function on your own files.
Terms & privacy |
Contact CodeNGine Technologies SIRET: 85257252800010, VAT : FR 62852572528 |
About the company CodeNGine Technologies is software company based in the South of France that provides an advanced productivity code generation tool to developers using XML and JSON |
Copyright © 2021 CodeNGine Technologies