57 return i; 58 } 59 throw new InternalError(); // a bug in RelaxNGCC. 60 } 61 62 63 /** Parent handler. */ 64 private final NGCCHandler _parent; 65 /** Cookie given by the parent. */ 66 private final int _cookie; 67 68 69 70 // 71 // 72 // event handler 73 // 74 // 75 /** 76 * Receiver that is being locked and therefore receives all the events. 77 * <pre><xmp> 78 * <interleave> 79 * <element name="foo"/> 80 * <element name="bar"> 81 * <element name="foo"/> 82 * </element> 83 * </interlaeve> 84 * </xmp></pre> 85 * When processing inside the bar element, this receiver is 86 * "locked" so that it can correctly receive its child foo element. 87 */ 88 private int lockedReceiver; 89 /** 90 * Nest level. Lock will be release when the lockCount becomes 0. 91 */ 92 private int lockCount=0; 93 94 public void enterElement( 95 String uri, String localName, String qname,Attributes atts) throws SAXException { 96 97 if(isJoining) return; // ignore any token if we are joining. See joinByXXXX. 98 99 if(lockCount++==0) { 100 lockedReceiver = findReceiverOfElement(uri,localName); 101 if(lockedReceiver==-1) { 102 // we can't process this token. join. 103 joinByEnterElement(null,uri,localName,qname,atts); 104 return; | 57 return i; 58 } 59 throw new InternalError(); // a bug in RelaxNGCC. 60 } 61 62 63 /** Parent handler. */ 64 private final NGCCHandler _parent; 65 /** Cookie given by the parent. */ 66 private final int _cookie; 67 68 69 70 // 71 // 72 // event handler 73 // 74 // 75 /** 76 * Receiver that is being locked and therefore receives all the events. 77 * <pre>{@code 78 * <interleave> 79 * <element name="foo"/> 80 * <element name="bar"> 81 * <element name="foo"/> 82 * </element> 83 * </interlaeve> 84 * }</pre> 85 * When processing inside the bar element, this receiver is 86 * "locked" so that it can correctly receive its child foo element. 87 */ 88 private int lockedReceiver; 89 /** 90 * Nest level. Lock will be release when the lockCount becomes 0. 91 */ 92 private int lockCount=0; 93 94 public void enterElement( 95 String uri, String localName, String qname,Attributes atts) throws SAXException { 96 97 if(isJoining) return; // ignore any token if we are joining. See joinByXXXX. 98 99 if(lockCount++==0) { 100 lockedReceiver = findReceiverOfElement(uri,localName); 101 if(lockedReceiver==-1) { 102 // we can't process this token. join. 103 joinByEnterElement(null,uri,localName,qname,atts); 104 return; |