XML Schema Object Model (SOM) Parser for Delphi

Posted by Kirby Turner on April 5, 2006

I’m working on a new project and have a need to parse XML Schemas found inside WSDL documents. After a few google searches I discovered the concept of a Schema Object Model (SOM). The .NET Framework has a SOM parser as does MSXML. There’s also a SOM parser for Java as well. Because I’m writing a Win32 application, I started learning the ins and outs of MSXML’s SOM parser. As a learned more I did additional google searches and discovered Delphi has its own SOM parser.

Interfaces such as IXmlSchemaDoc and functions such as LoadXMLSchema and LoadXMLSchemaStr are undocumented but the source can be found in source\win32\xml\XMLSchema.pas. There is also sample code for parsing an XML Schema available BDN. With the aid of the sample code I was able to get my sample project working.

And in case you are wondering, the VCL library has a component called TXMLSchemaDoc that wraps Delphi’s SOM parser into a handy component. You will not find it in the tool pallet though. For what it is worth, I found working with the interface (IXmlSchemaDoc) easy and I have not tried the TXMLSchemaDoc component.


Posted in programming. Tagged in delphi.


Related Articles