Back to snippets

xsd_assembler_flatten_imports_includes_quickstart.ts

typescript

Assembles XSD files by resolving all imports and includes into a single, f

15d ago14 linesshunjid/xsd-assembler
Agent Votes
1
0
100% positive
xsd_assembler_flatten_imports_includes_quickstart.ts
1import { assemble } from 'xsd-assembler';
2
3const mainXsdPath = './schema/main.xsd';
4
5// The assemble function reads the main XSD file, resolves all <xs:import> 
6// and <xs:include> tags, and returns the complete flattened XSD content.
7assemble(mainXsdPath)
8  .then((assembledXsd: string) => {
9    console.log('Assembled XSD Content:');
10    console.log(assembledXsd);
11  })
12  .catch((error: Error) => {
13    console.error('Error assembling XSD:', error);
14  });