PDA

View Full Version : Processing XSD schemas using VBA



martinrydman
06-11-2008, 06:44 AM
Hi,

I'm trying to find a way to process a XSD schema as an internal structure in VBA. The use case is that I try to produce an easy-to-read tree structure into a worksheet representing the XSD (I'm trying to build a simple documentation tool where end users can easily document how a elements in a schema maps to some other, non-XML structure). Anyone done anything similar?

Thanks in advance!

/Martin

Oorang
06-11-2008, 11:07 AM
Hi Martin,
You can access the XML parser included in the MDAC. The XML library for exposed to COM (and thereby VBA) is msxml2.dll. You can access it's properties and methods by setting a reference to that file. The MSDN documentation is currently here: http://msdn.microsoft.com/en-us/library/ms763742.aspx

If you into trouble post back:)

martinrydman
06-11-2008, 12:06 PM
Hi,

Thanks for your reply. I am aware of MSXML2 and have used it occasionally to process XML-files, but as far as I can tell, there is no way to process schemas as such. I did find an XMLSchemaCashe class, but from the little I read anout it, it seems to require an XML-file with a schema reference, and it's primary purpose is to cashe schemas to speed up validation, if I understood correctly. I'm looking for something that could (by using a method) read an .xsd-file from disk and leave me with a structure that I could traverse and produce the desired simplified tree I'm looking for.

/Martin

PawelG
04-10-2013, 02:28 AM
Hi,

I have the same problem. I have schema in xsd file and I want read this schema, to get from it elements structure, in vba. I use msxml6.dll. I tray with XMLSchemaCache60 but I can't read xsd file. I you have more inforamtion about it, I will be very grateful if you tell me.