private void handleStartElement(XMLStreamReader parser,Set<Node> childrenFound,Handler handler,Map<String,Object> values,Stack<Set<String>> stack,boolean recordStarted) throws IOException, XMLStreamException {
  Node n=getMatchingNode(parser,childNodes);
  Map<String,Object> decends=new HashMap<>();
  if (n != null) {
    childrenFound.add(n);
    n.parse(parser,handler,values,stack,recordStarted);
    return;
  }
  Node dn=this;
  do {
    if (dn.wildCardNodes != null) {
      n=getMatchingNode(parser,dn.wildCardNodes);
      if (n != null) {
        childrenFound.add(n);
        n.parse(parser,handler,values,stack,recordStarted);
        break;
      }
      for (      Node nn : dn.wildCardNodes)       decends.put(nn.name,nn);
    }
    dn=dn.wildAncestor;
  }
 while (dn != null);
  if (n == null) {
    int count=1;
    while (count != 0) {
      int token=parser.next();
      if (token == START_ELEMENT) {
        Node nn=(Node)decends.get(parser.getLocalName());
        if (nn != null) {
          childrenFound.add(nn);
          nn.parse(parser,handler,values,stack,recordStarted);
        }
 else         count++;
      }
 else       if (token == END_ELEMENT)       count--;
    }
  }
}

private void handleStartElement ( XMLStreamReader parser , Set < Node > childrenFound , Handler handler , Map < String , Object > values , Stack < Set < String > > stack , boolean recordStarted ) throws IOException , XMLStreamException { Node n = getMatchingNode ( parser , childNodes ) ; Map < String , Object > decends = new HashMap < > ( ) ; if ( n != null ) { childrenFound . add ( n ) ; n . parse ( parser , handler , values , stack , recordStarted ) ; return ; } Node dn = this ; do { if ( dn . wildCardNodes != null ) { n = getMatchingNode ( parser , dn . wildCardNodes ) ; if ( n != null ) { childrenFound . add ( n ) ; n . parse ( parser , handler , values , stack , recordStarted ) ; break ; } for ( Node nn : dn . wildCardNodes ) decends . put ( nn . name , nn ) ; } dn = dn . wildAncestor ; } while ( dn != null ) ; if ( n == null ) { int count = 1 ; while ( count != 0 ) { int token = parser . next ( ) ; if ( token == START_ELEMENT ) { Node nn = ( Node ) decends . get ( parser . getLocalName ( ) ) ; if ( nn != null ) { childrenFound . add ( nn ) ; nn . parse ( parser , handler , values , stack , recordStarted ) ; } else count ++ ; } else if ( token == END_ELEMENT ) count -- ; } } }
if a new tag is encountered , check if it is of interest or not by seeing if it matches against our node tree . if we have deperted from the node tree then walk back though the tree ' s ancestor nodes checking to see if any / / expressions exist for the node and compare them against the new tag . if matched then " jump " to that node , otherwise ignore the tag . note , the list of / / expressions found while walking back up the tree is chached in the hashmap decends . then if the new tag is to be skipped , any inner chil tags are compared against the cache and jumped to if matched .
