Konstantin Tokarev wrote: > Geometry optimization and other thing from Molpro outputs could be easily > read from XML output file, introduced in 2008.1. But while calculation is > running or if it didn't finish correctly, XML file is formally invalid > (missing closing tags) > > Is it possible to read invalid XML in OB? It contains proper CML's for every > optimization step, maybe they could be extracted somehow? > > Another possible solution is to request valid XML generation, but it can take > a long time to appear > It seems that OB can read CML files with a block of complete <molecule> </molecule> objects enclosed in any number of elements (<cml> etc.) that have been opened but not closed. Or do the Molpro files have a more complicated structure?
In OB XML files are parsed with the libxml2 xmlreader module which interprets on the fly, rather than loading the whole DOM tree first, which is what is required here. With incomplete files, it gives an error message at the end but seems to read the molecules ok. CMLFormat will read all the <molecules>s in the cml namespace in a file, even if there is other extraneous data surrounding them. (I think it will also read molecules from more than one namespace in the same document, e.g. PubChem and CML.) Chris ------------------------------------------------------------------------------ _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel