I have filed the following Jmol problem as a bug, but I think it warrants greater discussion:

The following "CML" file from our Xindice database

<entry src:col="/db/wwmm/nci/entry" src:key="nci_006229.xml">
 <identifier tautomeric="0" version="0.932Beta">
   <basic>C10H8,1H-2H-6H-10-8H-4H-3H-7H-9(10)5H-1</basic>
   <charge/>
 </identifier>
 <molecule formalCharge="0" id="NSC6229">
   <formula>C 10 H 8</formula>
... snipped ...
</entry>

has namespaced prefixes added by Xindice but without the namespace URI (xmlns:src). This is an invalid file if validation is enforced but I think is otherwise OK. Under java1.4 there is no problem but under 1.5 the applet stops at a black background with the Java console error:

SmarterJmolAdapter:The Resolver thinks:Cml SmarterJmolAdapter:The Resolver thinks:Cml SmarterJmolAdapter:The Resolver thinks:Cml SmarterJmolAdapter:The Resolver thinks:Cml Using JAXP/SAX XML parser. Using JAXP/SAX XML parser. Using JAXP/SAX XML parser. SAX FATAL:The prefix "src" for attribute "src:col" associated with an element type "molecule" is not bound. org.xml.sax.SAXParseException: The prefix "src" for attribute "src:col" associated with an element type "molecule" is not bound.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.jmol.adapter.smarter.CmlReader.readAtomSetCollection(CmlReader.java:71)


...... and more

I think this should be trapped and reported as it fooled us for at least a day! In the future it is almost certain that people will submit "invalid" files on a regular basis and so validation should be switched off by default.

I think this problem is intermediate between validation and non-validation. Without a schema there can be no validation so it's not a validation error, but it is certainly well-formed. I am not quite sure whether it is reasonable for a parser to throw a fatal error with the above file (It is also not very helpful for Xindice to emit it like this, although it is possible it is our fault). I suppose we shall retrofit the namespaceURI.

Even advance brings its own crop of problems!

P.

Peter Murray-Rust
Unilever Centre for Molecular Informatics
Chemistry Department, Cambridge University
Lensfield Road, CAMBRIDGE, CB2 1EW, UK
Tel: +44-1223-763069



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to