Skip to Content

Script to generate XSD from XML model

Aug 28, 2017 at 06:34 PM


avatar image
Former Member

I'm needing to automate the generation of XSD files from XML models. Does anyone have a sample script that will read XML models from the repository and generate XSD files?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Phillip Lam
Aug 30, 2017 at 06:03 PM

You need check out the model first.

This is an example.

Assume you have myXML.xsm in myFolder under root in the repository.

Connect to the repository first. The following code generates XSD in C:\Temp\output.txt

Set model = RepositoryConnection.FindChildByPath("myFolder\myXML", PdRMG.Cls_RepositoryModel)
model.CheckOutToFile "C:\Temp\myXML.xsm", 1

Set fso = CreateObject("Scripting.FilesystemObject")
Set f = fso.CreateTextFile("C:\Temp\output.txt", true)

f.writeLine ActiveModel.preview

10 |10000 characters needed characters left characters exceeded