> Miguel: [Fri, Jul 22, 2005 at 04:06:33PM -0400]:
>>
>> > Can I use an inline cml document as input to
>> > an embedded Jmol instance in my html document?
>>
>> Loading molecular models as strings into Jmol is supported. This works
>> independent of the file type ... cml, xyz, pdb.
>
> I know - but I don't want to do this. I have a mixed-namespace
> xml document, with html interpretable by a web browser, and
> cml molecular structures. I can use javascript within this
> document to access the cml structure as a tree of DOM nodes.

I see.

> If I could pass this straight to a Jmol instance, it wouldn't
> need to parse the XML - it would already be parsed into nodes
> and would be directly manipulable.

Well, it would not help Jmol very much. The CML reader does not load the
entire xml document. Rather, it uses the 'event trigger' model as it makes
a single pass through the text version of the xml document.

(I do not know what the proper terminology is to describe this :-)

> I could, I suppose, once I've retrieved the relevant cml
> node, use javascript to traverse the entire cml
> subtree and write out a string of cml to pass to loadInline, but
> that seems a very roundabout way to do things.

Honestly, I think that is what I recommend. Certainly if you want to get
it done in the short term.

Since you are working with CML I suspect that you are working with small
molecules, so the data is not too big.

Egon is interested in XML & CML, so perhaps he would be interested in
working on something like this. But he is currently on holiday.

> I can't have the cml in my document as a javascript string
> literal because the entire document is generated by xslt, so
> I have no control over whitespace (including newline) output.

I do not understand.

I have never used xslt ... but I thought that the whole idea was to allow
you to translate into various target formats.


Taking a step back ... why aren't you just reading the CML file out of
your database rather than trying to stick it inline?

I assume that your application wants to do something ...

So, just do both ... stick it inline for your application but let Jmol
read it out of your database through a separate URL reference.



Miguel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to