So, here's my attempt to include CML in a blogspot.com blog. OpenBabel 2.0 can create good CML, for example for acetic acid [1]:
Nothing much to see, right? Well, that's good, because it's inserted as CML, not as anything readable, like this equivalent:
<cml:molecule xmlns:cml="http://www.xml-cml.org/schema/cml2/core">
<cml:atomArray atomID="a1 a2 a3 a4" elementType="C C O O" formalCharge="0 0 0 0"/>
<cml:bondArray atomRef1="a1 a2 a2" atomRef2="a2 a3 a4" order="1 2 1"/>
</cml:molecule>
I am curious how this will come out in the RSS feed. Maybe it is usefull; please read the comments for additional notes.
1.InChI=1/C2H4O2/c1-2(3)4/h1H3,(H,3,4)
I just checked the Atom feed (atom.xml) for this blog item. The CML gets nicely inserted using the appropriate CML namespace. So that's good. One big difference though, is that the CML now is child of the blog item content node, instead of next to it, as in most current CMLRSS feeds. But I'm happy with it! Only the CMLRSS client needs to do is look for CML anywhere in the blog item node :)
ReplyDeleteBTW, keep in mind that if you make CML output in which all data is in attributes, as in the above article, the CML will not show up at all in the visual content of the blog item.
ReplyDeleteThis is good if you want to include a large molecule, or a big reaction mechanism in the blog, and don't want to bother your readers with big CML blobs.
In OpenBabel 1 you can use the -x2an command line option to create such CML. Have not checked it, but OB2 must have a similar option.
Hi,
ReplyDeleteYour rss-feed is incorrect. It contains in the section where the code should be shown "<".
This is incorrect as the feed should be escaped, so in this case, your feed should contain "<" to properly escape the &.
Toma
Ignore my previous comment, let me try again ;-)
ReplyDeleteYour rss-feed is incorrect. It contains in the section where the code should be shown "<".
This is incorrect as the feed should be escaped, so in this case, your feed should contain "&lt;" to properly escape the &.
Toma
Hi Toma,
ReplyDeleteI'm not sure to which section you are referring here... I don't intend to output '<' in the visual output...
I've ran it through an Atom 1.0 validator which, and that one was OK with the CML stuff in the blog...
Additionally I tried a Atom 0.3 validator, but that one just ignored the CML bits...
Egon
Arghh... I tried to say:
ReplyDeleteI did not intend to show '<' in the output, but really '<cml'.
These comments have been invaluable to me as is this whole site. I thank you for your comment.
ReplyDeleteGreat news! Thank you.
ReplyDeleteIf interested, can visit Home insurance traveler blog.