Hey Brian Noone has built anything like that yet. Though quite a few folks seem to want something like that - generate an empty document based on a DTD then allow folks to add/modify certain bits.
Just a thought - would the MSV library from Sun help here - its an abstract schema tool that allows validation of XML against DTD, XML Schema, RelaxNG, Relax and Trex. It might be a bit 'meta' or abstract for you - just using a DTD would be easier - but it might be worth a look. By all means go for it - I'm interested it seeing what you come up with and we could submit your work into the dom4j distribution if you like? James ----- Original Message ----- From: "Brian Young" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 06, 2002 4:08 PM Subject: [dom4j-user] best way to retrofit a dom4j Document to a DTD > Our product allows users to map data from a number of datasources into a > target dom4j Document. As a result, the user may overlook or not wish > to be concerned about specific rules specified in the DTD. > > For example, assume a choice in a DTD (ELEM1 | ELEM2 | ELEM3) - BTW this > is a super trivial example. > > Now, the document the user creates if they don't use a provided feature > to suppress elements may end up looking like this and not be valid as > far as the DTD is concerned: > <ELEM1></ELEM1> > <ELEM2>somedata</ELEM2> > <ELEM3></ELEM3> > > Using a little logic, one could determine based on the choice in the DTD > that the output should really look like this (given that ELEM1 and ELEM3 > are empty): > > <ELEM2>somedata<ELEM3> > > The document will now validate. I thought I'd ask if someone has built > anything like this on top of dom4j, because I'm getting ready to build > it utilizing dom4j, Wutka's DTD parser and my own logic (which could get > complex with nested choices, sequences, etc) > > Thanks! > > > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
