public override void startElement(System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
        {
            currentChars = "";
            if ("entry".Equals(local) && !"bibtex:entry".Equals(raw) && !inEntry)
            {
                inEntry = true;
                entry = new Entry();
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if (atts.GetFullName(i).Equals("id"))
                    {
                        entry.ID = atts.GetValue(i);
                    }
                    else if (atts.GetFullName(i).Equals("term"))
                    {
                        entry.Label = atts.GetValue(i);
                    }
                }
            }
            if ("metadataList".Equals(local) && !inMetadataList)
            {
                inMetadataList = true;
            }

            // if we're in a metadataList then look at individual
            // metadata nodes and check for any whose content refers
            // to QSAR metadata and save that. Currently it does'nt 
            // differentiate between descriptorType or descriptorClass.
            // Do we need to differentiate?
            //
            // RG: I think so and so I save a combination of the dictRef attribute
            // and the content attribute
            if ("metadata".Equals(local) && inMetadataList)
            {
                for (int i = 0; i < atts.GetLength() - 1; i += 2)
                {

                    System.String dictRefValue = "";
                    if (atts.GetFullName(i).Equals("dictRef"))
                    {
                        dictRefValue = atts.GetValue(i);
                    }
                    if (atts.GetFullName(i + 1).Equals("content"))
                    {
                        System.String content = atts.GetValue(i + 1);
                        if (content.IndexOf("qsar-descriptors-metadata:") == 0)
                        {
                            entry.setDescriptorMetadata(dictRefValue + "/" + content);
                        }
                    }
                }
            }
        }
        public override void startElement(System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
        {
            currentChars = "";
            //logger.debug("START Element: ", raw);
            //logger.debug("  uri: ", uri);
            //logger.debug("  local: ", local);
            //logger.debug("  raw: ", raw);

            if ("atomType".Equals(local))
            {
                atomType = builder.newAtomType("R");
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if ("id".Equals(atts.GetFullName(i)))
                    {
                        atomType.AtomTypeName = atts.GetValue(i);
                    }
                }
            }
            else if ("atom".Equals(local))
            {
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if ("elementType".Equals(atts.GetFullName(i)))
                    {
                        atomType.Symbol = atts.GetValue(i);
                    }
                    else if ("formalCharge".Equals(atts.GetFullName(i)))
                    {
                        try
                        {
                            atomType.setFormalCharge(System.Int32.Parse(atts.GetValue(i)));
                        }
                        catch (System.FormatException exception)
                        {
                            //logger.error("Value of <atom> @", atts.GetFullName(i), " is not an integer: ", atts.GetValue(i));
                            //logger.debug(exception);
                        }
                    }
                }
            }
            else if ("scalar".Equals(local))
            {
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if ("dictRef".Equals(atts.GetFullName(i)))
                    {
                        if ("cdk:maxBondOrder".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_MAXBONDORDER;
                        }
                        else if ("cdk:bondOrderSum".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_BONDORDERSUM;
                        }
                        else if ("cdk:hybridization".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_HYBRIDIZATION;
                        }
                        else if ("cdk:formalNeighbourCount".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_FORMALNEIGHBOURCOUNT;
                        }
                        else if ("cdk:valency".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_VALENCY;
                        }
                        else if ("cdk:formalCharge".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_FORMALCHARGE;
                        }
                        else if ("cdk:DA".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_DA;
                        }
                        else if ("cdk:sphericalMatcher".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_SPHERICALMATCHER;
                        }
                        else if ("cdk:ringSize".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_RINGSIZE;
                        }
                        else if ("cdk:ringConstant".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_CHEMICALGROUPCONSTANT;
                        }
                        else if ("cdk:aromaticAtom".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_ISAROMATIC;
                        }
                        else if ("emboss:vdwrad".Equals(atts.GetValue(i)))
                        {
                            scalarType = SCALAR_VANDERWAALSRADIUS;
                        }
                    }
                }
            }
        }
 private System.String getElementSymbol(SaxAttributesSupport atts)
 {
     for (int i = 0; i < atts.GetLength(); i++)
     {
         if ("id".Equals(atts.GetFullName(i)))
         {
             return atts.GetValue(i);
         }
     }
     return "";
 }
 private IIsotope createIsotopeOfElement(System.String currentElement, SaxAttributesSupport atts)
 {
     IIsotope isotope = builder.newIsotope(currentElement);
     for (int i = 0; i < atts.GetLength(); i++)
     {
         try
         {
             if ("id".Equals(atts.GetFullName(i)))
             {
                 isotope.ID = atts.GetValue(i);
             }
             else if ("isotopeNumber".Equals(atts.GetFullName(i)))
             {
                 isotope.MassNumber = System.Int32.Parse(atts.GetValue(i));
             }
             else if ("elementType".Equals(atts.GetFullName(i)))
             {
                 isotope.Symbol = atts.GetValue(i);
             }
         }
         catch (System.FormatException exception)
         {
             //logger.error("Value of isotope@", atts.GetFullName(i), " is not as expected.");
             //logger.debug(exception);
         }
     }
     return isotope;
 }
 public override void startElement(System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
 {
     currentChars = "";
     dictRef = "";
     //logger.debug("startElement: ", raw);
     //logger.debug("uri: ", uri);
     //logger.debug("local: ", local);
     //logger.debug("raw: ", raw);
     if ("isotope".Equals(local))
     {
         workingIsotope = createIsotopeOfElement(currentElement, atts);
     }
     else if ("isotopeList".Equals(local))
     {
         currentElement = getElementSymbol(atts);
     }
     else if ("abundance".Equals(local))
     {
         //logger.warn("Disregarding dictRef for now...");
     }
     else if ("scalar".Equals(local))
     {
         for (int i = 0; i < atts.GetLength(); i++)
         {
             if ("dictRef".Equals(atts.GetFullName(i)))
             {
                 dictRef = atts.GetValue(i);
             }
         }
     }
 }
 public override void startElement(System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
 {
     currentChars = "";
     dictRef = "";
     //logger.debug("startElement: ", raw);
     //logger.debug("uri: ", uri);
     //logger.debug("local: ", local);
     //logger.debug("raw: ", raw);
     if ("elementType".Equals(local))
     {
         for (int i = 0; i < atts.GetLength(); i++)
         {
             if ("id".Equals(atts.GetFullName(i)))
             {
                 elementType = new PeriodicTableElement(atts.GetValue(i));
             }
         }
     }
     else if ("scalar".Equals(local))
         for (int i = 0; i < atts.GetLength(); i++)
         {
             if ("dictRef".Equals(atts.GetFullName(i)))
             {
                 if ("cas:id".Equals(atts.GetValue(i)))
                 {
                     scalarType = LABEL_CAS;
                 }
                 else if ("cdk:name".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_NAME;
                 }
                 else if ("cdk:atomicNumber".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_ATOMICNUMBER;
                 }
                 else if ("cdk:name".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_NAME;
                 }
                 else if ("cdk:chemicalSerie".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_CHEMICALSERIE;
                 }
                 else if ("cdk:period".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_PERIOD;
                 }
                 else if ("cdk:group".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_GROUP;
                 }
                 else if ("cdk:phase".Equals(atts.GetValue(i)))
                 {
                     scalarType = SCALAR_PHASE;
                 }
             }
         }
 }
Example #7
0
        public override void startElement(System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
        {
            xpath.push(local);
            //if (debug)
            //    logger.debug("<", raw, "> -> ", xpath);
            // Detect CML modules, like CRML and CCML
            if (local.StartsWith("reaction"))
            {
                // e.g. reactionList, reaction -> CRML module
                //logger.info("Detected CRML module");
                conv = new CMLReactionModule(conv);
                conventionStack.push(conventionStack.current());
            }
            else
            {
                // assume CML Core

                // Detect conventions
                System.String convName = "";
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if (atts.GetFullName(i).Equals("convention"))
                    {
                        convName = atts.GetValue(i);
                    }
                }
                if (convName.Length > 0)
                {
                    if (convName.Equals(conventionStack.current()))
                    {
                        //logger.debug("Same convention as parent");
                    }
                    else
                    {
                        //logger.info("New Convention: ", convName);
                        if (convName.Equals("CML"))
                        {
                            /* Don't reset the convention handler to CMLCore,
                            becuase all handlers should extend this handler,
                            and use it for any content other then specifically
                            put into the specific convention */
                        }
                        else if (convName.Equals("PDB"))
                        {
                            conv = new PDBConvention(conv);
                        }
                        else if (convName.Equals("PMP"))
                        {
                            conv = new PMPConvention(conv);
                        }
                        else if (convName.Equals("MDLMol"))
                        {
                            //if (debug)
                            //    logger.debug("MDLMolConvention instantiated...");
                            conv = new MDLMolConvention(conv);
                        }
                        else if (convName.Equals("JMOL-ANIMATION"))
                        {
                            conv = new JMOLANIMATIONConvention(conv);
                        }
                        else if (userConventions.ContainsKey(convName))
                        {
                            //unknown convention. userConvention?
                            ICMLConvention newconv = (ICMLConvention)userConventions[convName];
                            newconv.inherit(conv);
                            conv = newconv;
                        }
                        else
                        {
                            //logger.warn("Detected unknown convention: ", convName);
                        }
                    }
                    conventionStack.push(convName);
                }
                else
                {
                    // no convention set/reset: take convention of parent
                    conventionStack.push(conventionStack.current());
                }
            }
            //if (debug)
            //    logger.debug("ConventionStack: ", conventionStack);
            conv.startElement(xpath, uri, local, raw, atts);
        }
Example #8
0
        public virtual void startElement(CMLStack xpath, System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
        {

            System.String name = local;
            ////logger.debug("StartElement");
            currentChars = "";

            BUILTIN = "";
            DICTREF = "";

            for (int i = 0; i < atts.GetLength(); i++)
            {
                System.String qname = atts.GetFullName(i);
                if (qname.Equals("builtin"))
                {
                    BUILTIN = atts.GetValue(i);
                    ////logger.debug(name, "->BUILTIN found: ", atts.GetValue(i));
                }
                else if (qname.Equals("dictRef"))
                {
                    DICTREF = atts.GetValue(i);
                    ////logger.debug(name, "->DICTREF found: ", atts.GetValue(i));
                }
                else if (qname.Equals("title"))
                {
                    elementTitle = atts.GetValue(i);
                    ////logger.debug(name, "->TITLE found: ", atts.GetValue(i));
                }
                else
                {
                    ////logger.debug("Qname: ", qname);
                }
            }

            if ("atom".Equals(name))
            {
                atomCounter++;
                for (int i = 0; i < atts.GetLength(); i++)
                {

                    System.String att = atts.GetFullName(i);
                    System.String value_Renamed = atts.GetValue(i);

                    if (att.Equals("id"))
                    {
                        // this is supported in CML 1.x
                        elid.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("elementType"))
                    {
                        elsym.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("title"))
                    {
                        eltitles.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("x2"))
                    {
                        x2.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("xy2"))
                    {
                        SupportClass.Tokenizer tokenizer = new SupportClass.Tokenizer(value_Renamed);
                        x2.Add(tokenizer.NextToken());
                        y2.Add(tokenizer.NextToken());
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("xyzFract"))
                    {
                        SupportClass.Tokenizer tokenizer = new SupportClass.Tokenizer(value_Renamed);
                        xfract.Add(tokenizer.NextToken());
                        yfract.Add(tokenizer.NextToken());
                        zfract.Add(tokenizer.NextToken());
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("xyz3"))
                    {
                        SupportClass.Tokenizer tokenizer = new SupportClass.Tokenizer(value_Renamed);
                        x3.Add(tokenizer.NextToken());
                        y3.Add(tokenizer.NextToken());
                        z3.Add(tokenizer.NextToken());
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("y2"))
                    {
                        y2.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("x3"))
                    {
                        x3.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("y3"))
                    {
                        y3.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("z3"))
                    {
                        z3.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("xFract"))
                    {
                        xfract.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("yFract"))
                    {
                        yfract.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("zFract"))
                    {
                        zfract.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("formalCharge"))
                    {
                        formalCharges.Add(value_Renamed);
                    }
                    // this is supported in CML 2.0 
                    else if (att.Equals("hydrogenCount"))
                    {
                        hCounts.Add(value_Renamed);
                    }
                    else if (att.Equals("isotope"))
                    {
                        isotope.Add(value_Renamed);
                    }
                    else if (att.Equals("dictRef"))
                    {
                        atomDictRefs.Add(value_Renamed);
                    }
                    else if (att.Equals("spinMultiplicity"))
                    {
                        spinMultiplicities.Add(value_Renamed);
                    }
                    else
                    {
                        ////logger.warn("Unparsed attribute: " + att);
                    }
                }
            }
            else if ("atomArray".Equals(name))
            {
                bool atomsCounted = false;
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    System.String att = atts.GetFullName(i);
                    int count = 0;
                    if (att.Equals("atomID"))
                    {
                        count = addArrayElementsTo(elid, atts.GetValue(i));
                    }
                    else if (att.Equals("elementType"))
                    {
                        count = addArrayElementsTo(elsym, atts.GetValue(i));
                    }
                    else if (att.Equals("x2"))
                    {
                        count = addArrayElementsTo(x2, atts.GetValue(i));
                    }
                    else if (att.Equals("y2"))
                    {
                        count = addArrayElementsTo(y2, atts.GetValue(i));
                    }
                    else if (att.Equals("x3"))
                    {
                        count = addArrayElementsTo(x3, atts.GetValue(i));
                    }
                    else if (att.Equals("y3"))
                    {
                        count = addArrayElementsTo(y3, atts.GetValue(i));
                    }
                    else if (att.Equals("z3"))
                    {
                        count = addArrayElementsTo(z3, atts.GetValue(i));
                    }
                    else if (att.Equals("xFract"))
                    {
                        count = addArrayElementsTo(xfract, atts.GetValue(i));
                    }
                    else if (att.Equals("yFract"))
                    {
                        count = addArrayElementsTo(yfract, atts.GetValue(i));
                    }
                    else if (att.Equals("zFract"))
                    {
                        count = addArrayElementsTo(zfract, atts.GetValue(i));
                    }
                    else
                    {
                        ////logger.warn("Unparsed attribute: " + att);
                    }
                    if (!atomsCounted)
                    {
                        atomCounter += count;
                        atomsCounted = true;
                    }
                }
            }
            else if ("bond".Equals(name))
            {
                bondCounter++;
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    System.String att = atts.GetFullName(i);
                    ////logger.debug("B2 ", att, "=", atts.GetValue(i));

                    if (att.Equals("id"))
                    {
                        bondid.Add(atts.GetValue(i));
                        ////logger.debug("B3 ", bondid);
                    }
                    else if (att.Equals("atomRefs") || att.Equals("atomRefs2"))
                    {
                        // this is CML 2.0 support

                        // expect exactly two references
                        try
                        {
                            SupportClass.Tokenizer st = new SupportClass.Tokenizer(atts.GetValue(i));
                            bondARef1.Add((System.String)st.NextToken());
                            bondARef2.Add((System.String)st.NextToken());
                        }
                        catch (System.Exception e)
                        {
                            //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                            ////logger.error("Error in CML file: ", e.Message);
                            ////logger.debug(e);
                        }
                    }
                    else if (att.Equals("order"))
                    {
                        // this is CML 2.0 support
                        order.Add(atts.GetValue(i).Trim());
                    }
                    else if (att.Equals("dictRef"))
                    {
                        bondDictRefs.Add(atts.GetValue(i).Trim());
                    }
                }

                stereoGiven = false;
                curRef = 0;
            }
            else if ("bondArray".Equals(name))
            {
                bool bondsCounted = false;
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    System.String att = atts.GetFullName(i);
                    int count = 0;
                    if (att.Equals("bondID"))
                    {
                        count = addArrayElementsTo(bondid, atts.GetValue(i));
                    }
                    else if (att.Equals("atomRefs1"))
                    {
                        count = addArrayElementsTo(bondARef1, atts.GetValue(i));
                    }
                    else if (att.Equals("atomRefs2"))
                    {
                        count = addArrayElementsTo(bondARef2, atts.GetValue(i));
                    }
                    else if (att.Equals("atomRef1"))
                    {
                        count = addArrayElementsTo(bondARef1, atts.GetValue(i));
                    }
                    else if (att.Equals("atomRef2"))
                    {
                        count = addArrayElementsTo(bondARef2, atts.GetValue(i));
                    }
                    else if (att.Equals("order"))
                    {
                        count = addArrayElementsTo(order, atts.GetValue(i));
                    }
                    else
                    {
                        ////logger.warn("Unparsed attribute: " + att);
                    }
                    if (!bondsCounted)
                    {
                        bondCounter += count;
                        bondsCounted = true;
                    }
                }
                curRef = 0;
            }
            else if ("molecule".Equals(name))
            {
                newMolecule();
                BUILTIN = "";
                cdo.startObject("Molecule");
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    if (atts.GetFullName(i).Equals("id"))
                    {
                        cdo.setObjectProperty("Molecule", "id", atts.GetValue(i));
                    }
                    else if (atts.GetFullName(i).Equals("dictRef"))
                    {
                        cdo.setObjectProperty("Molecule", "dictRef", atts.GetValue(i));
                    }
                }
            }
            else if ("crystal".Equals(name))
            {
                newCrystalData();
                cdo.startObject("Crystal");
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    System.String att = atts.GetFullName(i);
                    if (att.Equals("z"))
                    {
                        cdo.setObjectProperty("Crystal", "z", atts.GetValue(i));
                    }
                }
            }
            else if ("symmetry".Equals(name))
            {
                for (int i = 0; i < atts.GetLength(); i++)
                {
                    System.String att = atts.GetFullName(i);
                    if (att.Equals("spaceGroup"))
                    {
                        cdo.setObjectProperty("Crystal", "spacegroup", atts.GetValue(i));
                    }
                }
            }
            else if ("scalar".Equals(name))
            {
                if (xpath.ToString().EndsWith("crystal/scalar/"))
                    crystalScalar++;
            }
            else if ("list".Equals(name))
            {
                cdo.startObject("SetOfMolecules");
            }
        }
Example #9
0
        public override void startElement(CMLStack xpath, System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
        {
            System.String name = raw;
            isELSYM = false;

            if ("list".Equals(name))
            {

                for (int i = 0; i < atts.GetLength(); i++)
                {

                    if (atts.GetFullName(i).Equals("title") && atts.GetValue(i).Equals("sequence"))
                    {
                    }
                    else if (atts.GetFullName(i).Equals("title") && atts.GetValue(i).Equals("connections"))
                    {
                        // assume that Atom's have been read
                        //logger.debug("Assuming that Atom's have been read: storing them");
                        base.storeAtomData();
                        connectionTable = true;
                        //logger.debug("Start Connection Table");
                    }
                    else if (atts.GetFullName(i).Equals("title") && atts.GetValue(i).Equals("connect"))
                    {
                        //logger.debug("New connection");
                        isBond = true;
                    }
                    else if (atts.GetFullName(i).Equals("id") && isBond)
                    {
                        connect_root = atts.GetValue(i);
                    }

                    // ignore other list items at this moment
                }
            }
            else
            {
                base.startElement(xpath, uri, local, raw, atts);
            }
        }
 public override void startElement(CMLStack xpath, System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
 {
     if ("reaction".Equals(local))
     {
         cdo.startObject("Reaction");
         for (int i = 0; i < atts.GetLength(); i++)
         {
             System.String att = atts.GetFullName(i);
             System.String value_Renamed = atts.GetValue(i);
             if (att.Equals("id"))
             {
                 cdo.setObjectProperty("Reaction", "id", value_Renamed);
             }
         }
     }
     else if ("reactionList".Equals(local))
     {
         cdo.startObject("SetOfReactions");
         for (int i = 0; i < atts.GetLength(); i++)
         {
             System.String att = atts.GetFullName(i);
             System.String value_Renamed = atts.GetValue(i);
             if (att.Equals("id"))
             {
                 cdo.setObjectProperty("SetOfReactions", "id", value_Renamed);
             }
         }
     }
     else if ("reactant".Equals(local))
     {
         cdo.startObject("Reactant");
         for (int i = 0; i < atts.GetLength(); i++)
         {
             System.String att = atts.GetFullName(i);
             System.String value_Renamed = atts.GetValue(i);
             if (att.Equals("id"))
             {
                 cdo.setObjectProperty("Reactant", "id", value_Renamed);
             }
         }
     }
     else if ("product".Equals(local))
     {
         cdo.startObject("Product");
         for (int i = 0; i < atts.GetLength(); i++)
         {
             System.String att = atts.GetFullName(i);
             System.String value_Renamed = atts.GetValue(i);
             if (att.Equals("id"))
             {
                 cdo.setObjectProperty("Product", "id", value_Renamed);
             }
         }
     }
     else if ("molecule".Equals(local))
     {
         // do nothing for now
         base.newMolecule();
     }
     else
     {
         base.startElement(xpath, uri, local, raw, atts);
     }
 }
 public override void startElement(CMLStack xpath, System.String uri, System.String local, System.String raw, SaxAttributesSupport atts)
 {
     System.String name = local;
     if (name.Equals("list"))
     {
         //logger.debug("Oke, JMOLANIMATION seems to be kicked in :)");
         cdo.startObject("Animation");
         base.startElement(xpath, uri, local, raw, atts);
     }
     else if (name.Equals("molecule"))
     {
         cdo.startObject("Frame");
         //logger.debug("New frame being parsed.");
         base.startElement(xpath, uri, local, raw, atts);
     }
     else if (name.Equals("float"))
     {
         bool isEnergy = false;
         //logger.debug("FLOAT found!");
         for (int i = 0; i < atts.GetLength(); i++)
         {
             //logger.debug(" att: ", atts.GetFullName(i), " -> ", atts.GetValue(i));
             if (atts.GetFullName(i).Equals("title") && atts.GetValue(i).Equals("FRAME_ENERGY"))
             {
                 isEnergy = true;
             }
         }
         if (isEnergy)
         {
             // oke, this is the frames energy!
             current = ENERGY;
         }
         else
         {
             base.startElement(xpath, uri, local, raw, atts);
         }
     }
     else
     {
         base.startElement(xpath, uri, local, raw, atts);
     }
 }