I need to display a html form depending on an xsd file, I thought about generating xml from xsd and then generating json from xml and then displaying the form from the json.
There's this option in Eclipse, but i want to call this functionality in a class because i have a lot of xsd files and everytime i have to generate a different form. I also work with Tibco Bw and i found no automatic solution there.
In tibco BW5 I know 2 ways to create XML document from XSD:
"XML Instance" Activity: In Tibco Designer right mouse click on folder where you want to add XML -> Add resources -> XML Tools -> Instance. Then click "Set schema" in toolbar and select your schema. After that you can click "Source" and edit xml.
"Map Data" activity (Add Resources->General Activities-> Mapper). Set your xsd schema in the "input editor" tab and then put values in "Input" tab
If the xsd that you need to convert to XML is defined on runtime then you probably need to use xslt and "Transform XML" activity to generate XML. Please note that you can get xslt file from "Map Data" activity: inside "Map Data"->Input select input field then Ctrl+C and Ctrl+V to any text editor. Then you can create xslt file from the editor and use it in "Transform XML" activity. This way you can get "Transform XML" equivalent of "Map Data".
for converting XML to JSON you can use "Render JSON" activity from "REST and JSON" pallete. Please note that in BW5 "REST and JSON" plugin is not available from standard installtion.
I am not sure why you need to convert xml to json. You can try to convert xml directly to html using "Transform XML" tibco activity