I found this tool. CXSD
On their documentation: cxsd is a streaming XSD parser and XML parser generator for Node.js and (optionally but highly recommended) TypeScript. This is exactly what I need, so I follow their documentation and start to execute commands.
I have a problem when I try to execute this command: npm run cxsd file:///C:/XSDtoTypeScript/Flexinova.RBF.LI.V1.xsd
Unhandled rejection Error: Invalid URI "file:///C:/XSDtoTypeScript/Flexinova.RBF.LI.V1.xsd"
But when I try to open this from a browser, it opens normally. I don't know why URI is invalid? Does anyone know?
To create an XML file from an XSD file: Right-click the XML Documents folder in your data development project, and select New > XML. The New XML File wizard opens.
An XML Schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD).
• Run command: npm install http-server -g
• Open Node.js command prompt as administrator and raise your file on localhost using following command: http-server C:\XSDtoTypeScript
• Now try to open your xsd which is in this folder. Example: http://localhost:8080/Flexinova.RBF.LI.V1.xsd
Now use the command: npm run cxsd http://localhost:8080/Flexinova.RBF.LI.V1.xsd You are done 😊
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With