Search code examples
xmlxsdjsonschemaaltova

How to convert xsd to json schema in Altova XMLSpy 2014


Convert xsd to json schema in Altova XMLSpy 2014

xsd schema:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bem="https://test.server.com/xsd/testFile" targetNamespace="https://test.server.com/xsd/testFile" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="2.0.2023">
</xsd:schema>

Output I got is incorrect. It looks like JSON message not JSON schema. If is not possible I can do it in java as well.

Json:

{
    "XML": {
        "version": 1.0
    },
    "xsd:schema": {
        "xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
        "xmlns:bem": "https://test.server.com/xsd/testFile",
        "targetNamespace": "https://test.server.com/xsd/testFile",
        "elementFormDefault": "unqualified",
        "attributeFormDefault": "unqualified",
        "version": "2.0.2023",
        "Text": "\r"
    }
}

Can anyone of you please help in converting this ?


Solution

  • I think what you did is you converted XML to JSON - not XML Schema to JSON Schema.

    Their website says:

    You can start from scratch with a new schema document in XMLSpy, or generate a JSON Schema from an existing JSON instance or XSD, and customize it as required.

    So I would look into the „new JSON Schema“ dialog.