Say that I've got the following XML
<p>This is a <bold>paragraph</bold></p>
Obviously the schematics of this data and the constraints placed upon them can be described using XSD. For example, the following rules would apply:
* must be a document element as the top-level parent element
* must be at least one block element as a child of document
* each block must have a unique key value
* blocks can have 1...n p child elements.
* p elements can have 0...n bold child elements
* Q: Is the overall XML valid? A: yes / no + report
* Q: I'm looking at the element block (key="block2"). What are the valid child elements of this element? A: p (1...n).
* Q: I'm looking at the element p in the first block (key="block1"). What are the valid child elements of this element? A: #text, bold (0...n).
Determining the valid child elements of a particular element is something akin to how Visual Studio e.g. 2010 uses Intellisense. For example, given a schema Visual Studio let's you know what the valid elements are at a particular position as you type enter the XML.
Finally I've mentioned XSD / XML above but we do not necessarily have to be constrained to these technologies so alternative ideas will be appreciated equally as well.
Thank you for taking the time to examine my post.