From: E.L. W. <eg...@sc...> - 2004-02-19 15:19:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 18 February 2004 23:17, Peter Murray-Rust wrote: > At 18:51 18/02/2004 +0100, Stefan Kuhn wrote: > >Hi everybody, > >today I had a look into cmlwriter I found it writes tags directly to a > >stream. > >I think it would be a design improvement to build a org.w3c.dom.Document > >respectivly CMLDocument there (via jumbo classes) and write it. > > I agree. There are several reasons why this is useful: > - it allows namespaces to be manipulated properly > - doctype and xml declaration can be manipulated > - escaping and encoding is better controlled > - pretty printing is better controlled. > > The cleanest design is to create a Document and also a Serializer. The > latter can be set to manage the output styles independently of the > creation. > > In the case of CML there is an added benefit in that CML1/2 can be selected > and also array/nonarray format. Generally, now that the build process of the DOM is fully automatized, I think the time is there... especially for the Writer... But let's do this properly, by making a proper library IO interface between CDK and CMLDOM (any of those...)... i.e. let the new CMLWriter (replacing the current one) just serialize a CMLDOM, and the Convertor class in cdk/libio/cml convert CDK classes into CMLDOM... - - From CDK to CMLDOM is straightforward, as the former is just a subset of the latter... The other way around is far more difficult. Therefore, let's not really make a Reader for that... (CMLDOM already is that...), and just put the CMLDOM2CDK stuff in the Convertor class. Egon - - -- eg...@sc... PhD on Molecular Representation in Chemometrics Nijmegen University http://www.cac.sci.kun.nl/people/egonw/ GPG: 1024D/D6336BA6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (SunOS) iD8DBQFANNK1d9R8I9Yza6YRAoHXAJ921kqUwKKTR3NY1UTd88Ge2SozCgCfbVqQ 5oJXk1Kzu9BQ5G9V4Gsy9Vc= =WoZN -----END PGP SIGNATURE----- |