private void generateElement ( final INodeReadTrx paramRtx ) throws TTIOException { final AttributesImpl atts = new AttributesImpl ( ) ; final long key = paramRtx . getNode ( ) . getDataKey ( ) ; try { // Process namespace nodes. for ( int i = 0 , namesCount = ( ( ElementNode ) paramRtx . getNode ( ) ) . getNamespaceCount ( ) ; i < namesCount ; i ++ ) { paramRtx . moveToNamespace ( i ) ; final QName qName = paramRtx . getQNameOfCurrentNode ( ) ; mContHandler . startPrefixMapping ( qName . getPrefix ( ) , qName . getNamespaceURI ( ) ) ; final String mURI = qName . getNamespaceURI ( ) ; if ( qName . getLocalPart ( ) . length ( ) == 0 ) { atts . addAttribute ( mURI , "xmlns" , "xmlns" , "CDATA" , mURI ) ; } else { atts . addAttribute ( mURI , "xmlns" , "xmlns:" + paramRtx . getQNameOfCurrentNode ( ) . getLocalPart ( ) , "CDATA" , mURI ) ; } paramRtx . moveTo ( key ) ; } // Process attributes. for ( int i = 0 , attCount = ( ( ElementNode ) paramRtx . getNode ( ) ) . getAttributeCount ( ) ; i < attCount ; i ++ ) { paramRtx . moveToAttribute ( i ) ; final QName qName = paramRtx . getQNameOfCurrentNode ( ) ; final String mURI = qName . getNamespaceURI ( ) ; atts . addAttribute ( mURI , qName . getLocalPart ( ) , NodeWriteTrx . buildName ( qName ) , paramRtx . getTypeOfCurrentNode ( ) , paramRtx . getValueOfCurrentNode ( ) ) ; paramRtx . moveTo ( key ) ; } // Create SAX events. final QName qName = paramRtx . getQNameOfCurrentNode ( ) ; mContHandler . startElement ( qName . getNamespaceURI ( ) , qName . getLocalPart ( ) , NodeWriteTrx . buildName ( qName ) , atts ) ; // Empty elements. if ( ! ( ( ElementNode ) paramRtx . getNode ( ) ) . hasFirstChild ( ) ) { mContHandler . endElement ( qName . getNamespaceURI ( ) , qName . getLocalPart ( ) , NodeWriteTrx . buildName ( qName ) ) ; } } catch ( final SAXException exc ) { exc . printStackTrace ( ) ; } }
Generate a start element event .