xsd2json icon indicating copy to clipboard operation
xsd2json copied to clipboard

xsd2json produces empty output or hangs

Open ekzobrain opened this issue 5 years ago • 5 comments

Hi.

Trying to use xsd2json binary on mac os just hangs on attached XSD. When using on Debian Stretch it returns empty output.

What is wrong with this XSD or is this a bug?

RNI_ZY_1.0.1.xsd.txt

ekzobrain avatar Jan 26 '21 12:01 ekzobrain

The same on Ubuntu 20.10, SWI-Prolog version 8.2.1 for x86_64-linux.

marc1n avatar Feb 05 '21 14:02 marc1n

The command swipl -g main /home/marcinr/.local/bin/lib/node_modules/xsd2json/lib-pl/cli.pl -- ~/Downloads/RNI_ZY_1.0.1.xsd.txt hangs as well.

marc1n avatar Feb 05 '21 14:02 marc1n

I suspect that it actually does not hang but it is running really slow. After reducing the complexity of the attached file I've managed to generate JSON in about one minute (using compiled binary).

marc1n avatar Feb 05 '21 15:02 marc1n

Well, the full XSD attached is actually converting in 3 minutes on AMD Ryzen 3 3200G 3,6GHz, 16GB RAM, Ubuntu 20.10.

marc1n avatar Feb 05 '21 15:02 marc1n

I hit the same issue and figured out why this might be happening. The description field in my case is repeating:

"PrefrdMtd": {
	  "description":"PreferredMethod\nPreferred method used to reach the contact.\nPreferred method used to reach the contact.\nPreferredMethod\nPreferred method used to reach the contact.\nPreferred method used to reach the contact.\nPreferredMethod\nPreferred method used to reach the contact.\nPreferred method used to reach the contact.\nPreferredMethod\nPreferred method used to reach the contact.\nPreferred method used to reach the contact.\nPreferredMethod\nPreferred method used to reach the contact.

and it goes on and on for each description field. Looks like some kind of loop out of control.

bora-fsd avatar Sep 24 '21 16:09 bora-fsd