elementName = qName;
elementName = atts.getValue ("propertyname"); if (elementName == null) elementName = qName;
    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);	        currentNode = currentNode.createNode (qName);	    }	    // set the prototype on the current node and	    // add it to the map of parsed nodes.	    String name = atts.getValue ("name");	    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	           currentNode.setNode (qName, 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";	    elementName = qName;	    if (charBuffer == null)	        charBuffer = new StringBuffer();	    else	        charBuffer.setLength (0);	}    }