> You can use a technique similar to flgr's Junction or oGMo's criteria to build a > "parse tree". I'm not familiar with either library. How would you see a parse tree helping in this situation? > What would be really cool would be taking a DTD and generating the Ruby > code from that that validates the document as it is built. > It would be possible to define how blocks can be nested, etc, in > practice, ensuring that no illegal sequence of calls is made. Honestly I don't think it would be that hard to do. The hairiness of the project would be understanding the finer points of dtd. Simply creating a generator object with a smart method_missing shouldn't be that hard. This object could then recursively create other generator objects that contain the appropriate subset of the dtd for the section of the document you are working on. -- John Long http://wiseheartdesign.com