<gr********@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
>I have a website which requires user input of xml data. The xml data
is currently entered by hand in a multi-line textbox. The xml is
fairly complex and I have an XSD file to validate it when the user
submits the form. I'm using Atlas elsewhere in my website and I'd like
to use it to add intellisense when users are typing in the xml. Anyone
know how to do this or where I might look for a start?
Look at the XmlSchema class, and you'll see how it can be used to parse an
XSD schema, and then to read the definition programattically. You could use
this (with some effort) to provide feedback.
You could go farther, and use the schema to drive the user interface. For
instance, where the schema has an xsd:sequence with a multiplicity 1, you
could display a "+" sign which, when clicked, would create a new set of the
elements within the xsd:sequence. When there's an xsd:choice, you could
present radio buttons, one per choice. When one of the buttons is clicked,
you could then display the "input form" for that particular choice.
Microsoft's InfoPath product does this very well. You probably don't need to
be that fancy!
John