On Thursday 09 October 2003 17:19, Miguel wrote: > > Doing so of course immediately tells one that mayscript is not a > > valid attribute of applet (according to the XHTML schema). > > Hmmm ... Houston we have a problem. > > I just took a look at the W3C specifications ... and mayscript is not > listed as a valid attribute for <DEFANGED_applet> tags. (Of course, the > <DEFANGED_applet> tag itself is deprecated, but we won't go there :)
Might be interesting to explore which browsers support the preferred method... > But I assure you that I did not make it up. It has been a real thorn in > my side and I wish it did not exist. > > All the documentation for LiveConnect and all the articles I read on the > web make reference to this tag. And emperical evidence shows that, on at > least some browsers (especially the Netscape browsers), you *cannot* > call JavaScript from Java without it. > > > If it were, it > > would have to have a value, as shown below. Does your code handle the > > "correct" way of expressing it? > > Yes, as I mentioned above, I suggest mayScript="true" > > > Is the presence of mayscript imposed by the browser? > > I have not done an exhaustive search. But > - I *know* that NS4 does not work without it > - I *strongly suspect* that IE does not work without it > (I tried it but I don't remember the results) > - I *think* that modern releases of Mozilla require it > > > I ask since if there is any way at all of not having > > it, we should, since that would then enable users to write absolutely > > valid formal XHTML (which they could not if they include it). > > I may be wrong but ... > > I tested this once upon a time, and I think that if you write valid > XHTML that it will not work on some old browsers. My recollection is that > if you terminate tags with the terminating slash that some old browsers > don't work. As in: <tag .... /> A good example is <br/> which many older browser cannot cope with.... For this particular case, it could be replaced with <br /> which did work, btw... > I know that I stopped putting in the terminating slash because some old > browser I was using did not accept it. > > *Please* educate me on this, because I want my example code (and the > code generated by chime2jmol.pl) to be clean. But it is more important > to me that it work on old browsers. (That is why I have been using > <DEFANGED_applet> instead of <DEFANGED_object>) We could have two scripts... one for old browsers, one for valid XHTML and new browsers... > > Also, any more thoughts on how we might pass in-lined CML to the > > applet in a valid way? > > I have learned a few things about parameters that are passed to applets. > The problem I was trying to solve is that newline characters get > removed. > > I cannot find the reference right now, but about a month ago I read some > "specification" which explicitly said that, within the context of a > quoted attribute value, 'carriage return should be replaced with space > and newlines should be removed'. > > I went looking for this specification because I was having problems > passing multi-line scripts and simple .xyz files as parameters. What I > observed is that all the browsers were indeed ripping out the newlines. > > The solution for the scripts is to enforce semicolons as statement > terminators. > > My plan for chemical models is to say that the backslash character gets > replaced with newline characters when I read the model in. > > So, getting back to your question ... CML > > This would be a kludge but ... if you want to pick another pair of > characters I could easily change them to '<' and '>' as I read in the > inline model. > > What is the interest in 'inline' models anyway? I don't understand the > attraction/value. For autogenerated pages... if you have a separate file for the model, then you either need some sort of TMP dir, or modify your serving system so that it has a state and have the servlet (e.g.) serve a second page with the same content, but then in CML format with just the chemistry, and the first one with the (X)HTML wrapper... I used this approach three years ago... works fine, but is more difficult to program, and you need to make the serving system remember states... which might be a drawback for high performance applications... > > The obvious way would be to escape the < etc > > first. The example at http://jmol.sourceforge.net/applet.html > > is of course formally invalid XML (its amazing any browser allows > > it). > > Now, I'm not an XML guy but ... > It seems perfectly reasonable to me that it would work with the < and > > characters within the double quotes. Well not in XHTML... '<' are not allowed in attribute content in XML languages... >I don't think they should be > messing with the contents of *my* string ... that is what the quotes are > for. But remember that I am already upset that they are ripping out > *my* newline characters within *my* quoted string, so I guess I > shouldn't be surprised that they want to rip out *your* angle bracket > characters from *your* quoted string :) > > > One might think the formal way is to include the CML with its > > own namespace, which would avoid validation clashes with HTML (use > > openbabel > > -x1n or -x1an to generate namespaced CML) but I think the browsers > > simply would not handle this, or pass it to the applet. They are > > simply not able to handle "datuments" (ie multi component documents) > > (or am I wrong? Perhaps Mozilla can, since at one stage it was meant > > to be able to handle SVG as a component, along with HTML). No, I don't think the world is ready for that ;) Some time back I explorered the Pluglets of Mozilla (Java written plugins, much like applets) which, if I remember correctly, came closest to embedded information, but it never reached production level I think... > This is well beyond me. > > > Peter, any thoughts? > > > > Old: > > > > <DEFANGED_applet name="jmol" code="JmolApplet" archive="JmolApplet.jar" > > width=400 height=400 align="LEFT" mayscript > > > <param name=emulate value=chime> > > <param name=load value=1crn.pdb.gz> > > </applet> > > > > Tidied: > > > > > > <DEFANGED_applet name="jmol" code="JmolApplet" archive="JmolApplet.jar" > > width="400" height="400" align="left" mayscript="mayscript"> > > <param name="emulate" value="chime" /> > > <param name="load" value="1crn.pdb.gz" /> > > </applet> > > I agree that this is more tidied. > > I would prefer > mayscript='true' Fine too... > What is the XML recommendation on the case of attribute names ... I have > been thinking of switching to 'mayScript' instead of 'mayscript' ? > > So, does 'tidy' not complain about mayscript not being officially > recognized by w3c? The wonders of XML ;) Not sure what the correct answer is here... Egon -- PhD Molecular Representation in Chemometrics Laboratory of Analytical Chemistry http://www-cac.sci.kun.nl/people/egonw.html ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers
