code: public int getNextAttribute(int nodeHandle) {
                  nodeHandle &= NODEHANDLE_MASK;
                  nodes.readSlot(nodeHandle, gotslot);
  
                  //%REVIEW% Why are we using short here? There's no storage
                  //reduction for an automatic variable, especially one used
                  //so briefly, and it typically costs more cycles to process
                  //than an int would.
                  short type = (short) (gotslot[0] & 0xFFFF);
  
                  if (type == ELEMENT_NODE) {
                          return getFirstAttribute(nodeHandle);
                  } else if (type == ATTRIBUTE_NODE) {
                          if (gotslot[2] != NULL)
                                  return (m_docHandle | gotslot[2]);
                  }
                  return NULL;
          }
docs: Given a node handle, advance to the next attribute. If an
  element, we advance to its first attribute; if an attr, we advance to
  the next attr on the same node.
  
  @param nodeHandle int Handle of the node.
  @return int DTM node-number of the resolved attr,
  or DTM.NULL to indicate none exists.