Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert XSD to TypeScript

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?

like image 743
Nemanja Andric Avatar asked Aug 28 '18 10:08

Nemanja Andric


People also ask

Can we generate XML from XSD?

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.

Is XSD and schema same?

An XML Schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD).


1 Answers

• 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 😊

like image 137
Nemanja Andric Avatar answered Oct 01 '22 02:10

Nemanja Andric