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