xsd2json icon indicating copy to clipboard operation
xsd2json copied to clipboard

Support of xs:extension and xs:include

Open albanm opened this issue 11 years ago • 4 comments

Thanks for the impressive piece of work.

In your thesis you specifically mention that xsd2json doesn't support the extension of complex types. Do you have any project to fill this gap ? If not, do you have a solution in mind to implement this functionality that maybe another developer could contribute ?

I have no deep understanding of the problem or of your program, but I wonder if the simplest solution could be to do some merging of the complex types definitions before applying CHR rules ?

I also wonder about include and import that you say are not supported. Do you think a simple merge of included schemas in the root schema will do the trick ?

Basically: do you think a not too complex tranformation (xslt or other) applied on the schemas before processing by xsd2json could help overcome its limitations ?

Alban

albanm avatar Nov 04 '14 20:11 albanm

Hi Alban,

both problems are still there as I had no time to implement them yet :) The extension of complex types as well as xs:include and xs:import could be handled by XSLT of course, but I would prefer using only CHR. Especially as the namespace support is already implemented in xsd2json but currently not really used.

The best would be if you could provide some simple test cases in the /test directory. PRs welcome :)

I will take some time on the weekend to investigate possible solutions. What do you need first? Extensions or includes?

fnogatz avatar Nov 06 '14 18:11 fnogatz

Support of xs:include and xs:import has been added.

fnogatz avatar Feb 02 '15 22:02 fnogatz

are there some example to use it? I have a xsd file with include tag but I need to give a path where are all include xsd files dependencies ?

rudda avatar Nov 01 '19 19:11 rudda

The tests under /test/xsd contain some examples, maybe they are helpful for you?

  • test/xsd/include.xsd
  • test/xsd/include2.xsd
  • test/xsd/import.xsd

fnogatz avatar Nov 03 '19 15:11 fnogatz