Click to See Complete Forum and Search --> : Getting valid values for an XML node based on XSD


eg2000
April 25th, 2008, 01:46 PM
I am looking for a capability similar to the one used in the Eclipse (or whatever IDE) plugin where when you are editing and XML, it knows to autocomplete the necessary attributes for a new element, or give a drop down list of valid values for a new attribute, based on the XSD definition.

To be clear, I am NOT looking for the plugin (just mentioned it to clarify what I need), but rather for some existing library methods (or code) that, given an XMLNode/XMLAttribute object, can return me the valid values based on the XML file's XSD definition.

e.g. something like:
List<string> GetNecessaryAtributes(XMLNode mynode, string xsd_file)
List<string> GetValidValues(XMLAttribute myatt, string xsd_file)


thanks.

TheCPUWizard
May 11th, 2008, 12:35 AM
You should just be able to hijack the code from any "Validating" reader.....