stack.push( node ); currentPath = previousPath + '/' + qname; if ( !validate && ( broker.getDatabaseType() == DBBroker.DBM || broker.getDatabaseType() == DBBroker.NATIVE ) ) broker.store( node, currentPath );
rootNode = node; document.appendChild(node); document.setDocumentElement(node.getGID()); } node.setOwnerDocument(document); node.setAttributes((short) attributes.getLength()); if (prefixes.size() > 0) node.setPrefixes(prefixes);
    public void startElement( String namespace, String name,                              String qname, Attributes attributes ) {        ElementImpl last = null;        ElementImpl node = null;        // check for default namespaces//		if(namespace != null && namespace.length() > 0 &&//			qname.indexOf(':') < 0)//			qname = '#' + namespace + ':' + qname;			        if ( !stack.empty() ) {            last = (ElementImpl) stack.peek();            if ( charBuf != null && charBuf.length() > 0 ) {                final String normalized = charBuf.getNormalizedString( normalize );                if ( normalized.length() > 0 ) {                    text.setData( normalized );                    text.setOwnerDocument( document );                    charBuf.setLength(0);                    last.appendChildInternal( text );                    if ( !validate )                        broker.store( text, currentPath );                    text.clear();                }            }            if( !usedElements.isEmpty() ) {                node = (ElementImpl) usedElements.pop();                node.setNodeName( qname );            } else                node = new ElementImpl( qname );            last.appendChildInternal( node );        }        else {            if ( !validate )                node = new ElementImpl( 1, qname );            else                node = new ElementImpl( 0, qname );            rootNode = node;            document.appendChild( node );            document.setDocumentElement( node.getGID() );        }        node.setOwnerDocument( document );        node.setAttributes( (short) attributes.getLength() );        if ( prefixes.size() > 0 )            node.setPrefixes( prefixes );        stack.push( node );        currentPath = previousPath + '/' + qname;        if ( !validate && ( broker.getDatabaseType() == DBBroker.DBM ||            broker.getDatabaseType() == DBBroker.NATIVE ) )            broker.store( node, currentPath );        level++;        if ( document.getMaxDepth() < level )            document.setMaxDepth( level );        int attrLength = attributes.getLength();        if( attrLength > 0 && document.getMaxDepth() < level + 1 ) {        	document.setMaxDepth( level + 1 );        	if ( validate &&  document.getTreeLevelOrder( level + 1 ) <        			attrLength )        		document.setTreeLevelOrder( level + 1, attrLength );        }        String attrQName;        String attrPrefix;        String attrNS;        for ( int i = 0; i < attrLength; i++ ) {            attrNS = attributes.getURI( i );            attrQName = attributes.getQName( i );            // skip xmlns-attributes            if ( attrQName.startsWith( "xmlns" ) )                --attrLength;            else {                final AttrImpl attr =                    new AttrImpl( attrQName,                    		attributes.getValue( i ) );                attr.setOwnerDocument( document );                if(attributes.getType(i).equals("ID"))                	attr.setType(AttrImpl.ID);                node.appendChildInternal( attr );                if ( !validate )                    broker.store( attr, currentPath );            }        }        if ( attrLength > 0 )            node.setAttributes( (short) attrLength );        currentLine = locator.getLineNumber();        if ( !validate ) {            progress.setValue( currentLine );            setChanged();            notifyObservers( progress );        }        previousPath = currentPath;    }