currentNode.setNode(propName, n);
if ("hop:parent".equals(qName)) {   } else { currentNode.setNode(propName, n); }
    public void startElement(String namespaceURI, String localName, String qName,                             Attributes atts) throws SAXException {        // System.err.println ("XML-READ: startElement "+namespaceURI+", "+localName+", "+qName+", "+atts.getValue("id"));        // discard the first element called xmlroot        if ("xmlroot".equals(qName) && (currentNode == null)) {            return;        }        // if currentNode is null, this must be the hopobject node        String id = atts.getValue("id");        if (id != null) {            // check if there is a current node.            if (currentNode == null) {                // If currentNode is null, this is the root node we're parsing.                currentNode = rootNode;            } else if ("hop:child".equals(qName)) {                // it's an anonymous child node                nodeStack.push(currentNode);                currentNode = currentNode.createNode(null);            } else {                // it's a named node property                nodeStack.push(currentNode);                // property name may be encoded as "propertyname" attribute,                // otherwise it is the element name                String propName = atts.getValue("propertyname");                if (propName == null) {                    propName = qName;                }                currentNode = currentNode.createNode(propName);            }            // set the prototype on the current node and            // add it to the map of parsed nodes.            String prototype = atts.getValue("prototype");            if (!"".equals(prototype) && !"hopobject".equals(prototype)) {                currentNode.setPrototype(prototype);            }            String key = id + "-" + prototype;            convertedNodes.put(key, currentNode);            return;        }        // check if we have a currentNode to set properties on,        // otherwise throw exception.        if (currentNode == null) {            throw new SAXException("Invalid XML: No valid root HopObject found");        }        // check if we are inside a HopObject - otherwise throw an exception        if (!parsingHopObject) {            throw new SAXException("Invalid XML: Found nested non-HobObject elements");        }        // if we got so far, the element is not a hopobject. Set flag to prevent        // the hopobject stack to be popped when the element        // is closed.        parsingHopObject = false;        // Is it a reference to an already parsed node?        String idref = atts.getValue("idref");        if (idref != null) {            // a reference to a node that should have been parsed            // and lying in our cache of parsed nodes.            String prototyperef = atts.getValue("prototyperef");            String key = idref + "-" + prototyperef;            INode n = (INode) convertedNodes.get(key);            if (n != null) {                if ("hop:child".equals(qName)) {                    // add an already parsed node as child to current node                    currentNode.addNode(n);                } else {                    // set an already parsed node as node property to current node                    // property name may be encoded as "propertyname" attribute,                    // otherwise it is the element name                    String propName = atts.getValue("propertyname");                    if (propName == null) {                        propName = qName;                    }                    currentNode.setNode(propName, n);                }            }        } else {            // It's a primitive property. Remember the property name and type            // so we can properly parse/interpret the character data when we            // get it later on.            elementType = atts.getValue("type");            if (elementType == null) {                elementType = "string";            }            // property name may be encoded as "propertyname" attribute,            // otherwise it is the element name            elementName = atts.getValue("propertyname");            if (elementName == null) {                elementName = qName;            }            if (charBuffer == null) {                charBuffer = new StringBuffer();            } else {                charBuffer.setLength(0);            }        }    }