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
- Delphi (BDS) Live Templates for SQL Server
- CodeGear
- Delphi 2006 Survey
- Namespaces in Delphi
- Parse CSV or Tab Separated Files Using Delphi
- wpsCsvParser Fix
- Video Tutorials for Delphi
- CSV Parser for Delphi
- FREE 3rd Party Tool bundle with BDS 2006
- From Delphi to C# and Back Again