CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    2

    Getting valid values for an XML node based on XSD

    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.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Getting valid values for an XML node based on XSD

    You should just be able to hijack the code from any "Validating" reader.....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured