@Override
    public void startElement(final String uri, final String localName, final String tag, final Attributes attributes) throws SAXException {

        if (tag.equals("state")) {
            String stname = attributes.getValue("name");
            int tmes = Integer.parseInt(attributes.getValue("times"));
            boolean del = Boolean.parseBoolean(attributes.getValue("deleted"));

            State st = I;
            int len = stname.length();

            for (int i = len; i > 0; --i) {
                st = st.safeNext(stname.charAt(i - 1), false);
            }

            st.setTimes(tmes);
            if (del) {
                st.delete();
            }

        }
        if (tag.equals("pst")) {
            totalProb = Double.parseDouble(attributes.getValue("prob"));
        }

    }