User 870ab5b546
19-03-2013 15:24:40
Hello,
Using JChem/Marvin 5.11.5. The Javascript code:
var molstruct = String(applet.getMol('mrv'));
alert('got molstruct from applet:\n' + molstruct);
The alert message:
got molstruct from applet:
<?xml version="1.0"?><cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4 a5" elementType="C C C C C" x2="-3.3687500953674316 -4.614616424384458 -4.138754006997239 -2.5987461837376244 -2.1228837663504034" y2="1.743117244048722 0.8379006455367208 -0.6266467943831723 -0.6266467943831723 0.8379006455367208"></atomArray><bondArray><bond atomRefs2="a1 a2" order="1"></bond><bond atomRefs2="a1 a5" order="1"></bond><bond atomRefs2="a2 a3" order="1"></bond><bond atomRefs2="a3 a4" order="1"></bond><bond atomRefs2="a4 a5" order="1"></bond></bondArray></molecule></MChemicalStruct></MDocument>
</cml>
Note the lack of return characters in the obtained MRV. It's not a huge deal, but it makes it a lot harder to read. If I go to Edit -> Source in the applet, the MRV has return characters, and it's a lot easier to read:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5" elementType="C C C C C" x2="-3.3687500953674316 -4.614616424384458 -4.138754006997239 -2.5987461837376244 -2.1228837663504034" y2="1.743117244048722 0.8379006455367208 -0.6266467943831723 -0.6266467943831723 0.8379006455367208"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a1 a5" order="1"/>
<bond atomRefs2="a2 a3" order="1"/>
<bond atomRefs2="a3 a4" order="1"/>
<bond atomRefs2="a4 a5" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
The method MolExporter.exportToFormat(MDocument, String) also omits the return characters. The omission of return characters is a fairly recent development in Marvin. If you could change these methods back so that they again put the return characters in, it would make debugging much easier.
-- Bob