PDA

View Full Version : VBA XML/XSD DOM Method to Retrieve Attribute Restrictions



pengismo
03-08-2012, 07:11 AM
Hi All!

I have an XSD file (schema layout for an XML file) which has restrictions/enumerations for certain fields. E.g. my attribute is entitled "Car" and only certain values ("Honda", "Ford", "GMC", "Toyota", etc) are allowed.

Is there anyway or method using MSXML and/or the DOM XML model within VBA to derive the restrictions ("Honda", "Ford", "GMC", "Toyota", etc) for an attribute/node ("Car") from an XSD?

The ideal end state/my goal is to write a function after loading an XSD/XML Map where the xpath location of a node is passed in string format (e.g. "/Root/Car") and a string array is returned with the allowable fields for that node!

Any insight or references are greatly appreciated!

Thanks.