public void onElementStart(String name, String subElmName, int refId, AttributesMap attributes, Locator locator) throws SerializationException {

    if ("objects".equals(name)){ // [1]
        for (int i = 0; i < attributes.getLength(); i++) {
            String attrName = attributes.getName(i);
            try {
                String attrValue = attributes.getString(attrName);
                if ("framework.version".equals(attrName)) {
                    try {
                        XMLDeserializer.FRAMEWORK_VERSION.set(Version.parse(attrValue));
                    }
                    catch (Exception exception) {}
                }
                this.rootAttributes.put(attrName, attrValue);
            }
            catch (IOException e) {
                Logger.getLogger(getClass()).error("Error reading top-level attributes on deserialization.", e);
            }
        }

        if (this.rootAttributesOnly) {
            throw new XMLDeserializer.EarlyAbort();
        }
    }
    else if (subElmName != null) { // [2]
        try {
            ((DeserializationHandler)this.stack.getLast()).startSubElement(subElmName, attributes, this); // [3]
            updateRef(this.stack.getLast());
        }
        catch (LinkageError e) {
            throw createException(name, attributes, e, locator);
        }
        catch (Exception e) {
            throw createException(name, attributes, e, locator);
        }
    }
    else{
        DeserializationHandler handler = XMLDeserializer.this.lookupHandler(name); // [4]
        if (handler == null) {
            throw new SerializationException("Error: null deserialization handler for element '" + name + "'");
        }
        if (handler.supportsNestedElements()) {
            handler = handler.clone();
        }
        handler.setRefId(refId);

        try {
            handler.startElement(name, attributes, this); // [5]
        }
        catch (Exception e) {
            throw createException(name, attributes, e, locator);
        }

        updateRef(handler);
        this.stack.addLast(handler); // [6]
    }
}