fnogatz / xsd2json

Translate XML Schema into equivalent JSON Schema
MIT License
149 stars 28 forks source link

Only got empty object result #85

Closed praditha closed 6 years ago

praditha commented 6 years ago

Hi there, Thanks for this great library. I'm still cannot use this library properly. I'm using windows 10, node v8.11.1, SWI-Prolog v7.6.4, and xsd2json v1.11.6 and I installed it globally.

Here is the simple xsd I've used

<?xml version="1.0" encoding="UTF-8"?>

<shiporder orderid="889923" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shiporder.xsd">
  <orderperson>John Smith</orderperson>
  <shipto>
    <name>Ola Nordmann</name>
    <address>Langgt 23</address>
    <city>4000 Stavanger</city>
    <country>Norway</country>
  </shipto>
  <item>
    <title>Empire Burlesque</title>
    <note>Special Edition</note>
    <quantity>1</quantity>
    <price>10.90</price>
  </item>
  <item>
    <title>Hide your heart</title>
    <quantity>1</quantity>
    <price>9.90</price>
  </item>
</shiporder>

and then I've tried to run this on cmd xsd2json shiporder.xsd > schema.json and the result is schema.json file only contain

{
}

is there anything I've missed? Thanks.

fnogatz commented 6 years ago

Hi @praditha,

the document you specified is an XML and no XSD file. So it's pretty clear that xsd2json won't return any useful output ;)

fnogatz commented 6 years ago

I will close here. If its also a problem with an XSD file, please open a new issue.