public int getNextNamespaceNode ( int baseHandle , int nodeHandle , boolean inScope ) { if ( inScope ) { //Since we've been given the base, try direct lookup //(could look from nodeHandle but this is at least one //comparison/get-parent faster) //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask); SuballocatedIntVector nsContext = findNamespaceContext ( makeNodeIdentity ( baseHandle ) ) ; if ( nsContext == null ) return NULL ; int i = 1 + nsContext . indexOf ( nodeHandle ) ; if ( i <= 0 || i == nsContext . size ( ) ) return NULL ; return nsContext . elementAt ( i ) ; } else { // Assume that attributes and namespace nodes immediately follow the element. int identity = makeNodeIdentity ( nodeHandle ) ; while ( DTM . NULL != ( identity = getNextNodeIdentity ( identity ) ) ) { int type = _type ( identity ) ; if ( type == DTM . NAMESPACE_NODE ) { return makeNodeHandle ( identity ) ; } else if ( type != DTM . ATTRIBUTE_NODE ) { break ; } } } return DTM . NULL ; }
Given a namespace handle advance to the next namespace .