protected void startNode ( int node ) throws org . xml . sax . SAXException { XPathContext xcntxt = m_transformer . getXPathContext ( ) ; try { if ( DTM . ELEMENT_NODE == m_dtm . getNodeType ( node ) ) { xcntxt . pushCurrentNode ( node ) ; if ( m_startNode != node ) { super . startNode ( node ) ; } else { String elemName = m_dtm . getNodeName ( node ) ; String localName = m_dtm . getLocalName ( node ) ; String namespace = m_dtm . getNamespaceURI ( node ) ; //xcntxt.pushCurrentNode(node); // SAX-like call to allow adding attributes afterwards m_handler . startElement ( namespace , localName , elemName ) ; boolean hasNSDecls = false ; DTM dtm = m_dtm ; for ( int ns = dtm . getFirstNamespaceNode ( node , true ) ; DTM . NULL != ns ; ns = dtm . getNextNamespaceNode ( node , ns , true ) ) { SerializerUtils . ensureNamespaceDeclDeclared ( m_handler , dtm , ns ) ; } for ( int attr = dtm . getFirstAttribute ( node ) ; DTM . NULL != attr ; attr = dtm . getNextAttribute ( attr ) ) { SerializerUtils . addAttribute ( m_handler , attr ) ; } } } else { xcntxt . pushCurrentNode ( node ) ; super . startNode ( node ) ; xcntxt . popCurrentNode ( ) ; } } catch ( javax . xml . transform . TransformerException te ) { throw new org . xml . sax . SAXException ( te ) ; } }
Start traversal of the tree at the given node