Typescript
Approach is based on the XML Schema:
cxsd is a streaming XSD parser and XML parser generator for Node.js and TypeScript.
The input XML Schema must be provided by a web server.
cxsd generates the files XMLSchema.d.ts and XMLSchema.js.
Typescript Generation with cxsd - Windows Batch File
1set XSD_HOME=..\..\model_based\xsd_variants
2
3rem from https://github.com/charto/cxsd
4rem The first line just sets up NPM to allow calling cxsd without installing it globally. It also works on Windows if you omit the single quotes (').
5
6rem echo { "scripts": { "cxsd": "cxsd" } } > package.json
7rem npm install cxsd
8
9start python -m http.server --directory %XSD_HOME%
10TIMEOUT /T 10
11
12IF EXIST xmlns RMDIR /S /Q xmlns
13IF EXIST 42 RMDIR /S /Q 42
14IF NOT EXIST 42 MKDIR 42
15call npm run cxsd http://localhost:8000/ddi-cdi_42_noXsdTypeInName.xsd > 42.log 2>&1
16move xmlns 42
17
18IF EXIST xmlns RMDIR /S /Q xmlns
19IF EXIST 43 RMDIR /S /Q 43
20IF NOT EXIST 43 MKDIR 43
21call npm run cxsd http://localhost:8000/ddi-cdi_43_noXsdTypeInName.xsd > 43.log 2>&1
22move xmlns 43
23
24IF EXIST xmlns RMDIR /S /Q xmlns
25IF EXIST 44 RMDIR /S /Q 44
26IF NOT EXIST 44 MKDIR 44
27call npm run cxsd http://localhost:8000/ddi-cdi_44_noXsdTypeInName.xsd > 44.log 2>&1
28move xmlns 44
29
30IF EXIST xmlns RMDIR /S /Q xmlns
31IF EXIST 45 RMDIR /S /Q 45
32IF NOT EXIST 45 MKDIR 45
33call npm run cxsd http://localhost:8000/ddi-cdi_45_noXsdTypeInName.xsd > 45.log 2>&1
34move xmlns 45
35
36set XSD_HOME=