Miguel wrote:
>
>>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.

Fair enough. I'll have a go at that for the moment.

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

Not sure what counts as a small molecule, but I'm looking at 
anywhere from a few hundred up to a few thousand atoms, so
the inline string is going to be tens of thousands of characters
long.

> 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.

Yes ... but XSLT works best if the output target format
is some form of XML. So it's quite easy to get it
to produce CML, but (quite reasonably) it gives you
no control over meaningless syntactical details like
newline placement.

It's enormously more difficult to get it to produce CML 
where every newline is accompanied by a backslash to 
allow for Javascript string literals. I'd have to tell 
the XSLT to output in plaintext format, and
build up the entire output character by character, 
without any notion of XML well-formedness in the XSLT,
which makes it much more difficult to ensure that the
output is valid.

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

Erm - no database involved. This is from the output
of some computer simulations.

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

Firstly, I don't like having duplicated information
if I can at all avoid it. Secondly, I have it working 
at the moment using an external reference; but for 
various reasons, my life would be much easier if I 
only had to deal with a single file.

But thanks for your help anyway. I'll see what I can do
with Javascript rewriting.

-- 
Dr. Toby White 
Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK
Email: <[EMAIL PROTECTED]>


-------------------------------------------------------
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_id=7477&alloc_id=16492&op=click
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to