@Override protected void handleControlEnd( String uri, String localname, String qName, Attributes attributes, String staticId, String effectiveId, XFormsControl control) throws SAXException { handlerContext.popCaseContext(); final ElementHandlerController controller = handlerContext.getController(); if (!handlerContext.isNoScript()) { currentOutputInterceptor.flushCharacters(true, true); // Restore output controller.setOutput(currentSavedOutput); final boolean isMustGenerateBeginEndDelimiters = !handlerContext.isFullUpdateTopLevelControl(effectiveId); if (isMustGenerateBeginEndDelimiters) { if (currentOutputInterceptor.getDelimiterNamespaceURI() != null) { // Output end delimiter currentOutputInterceptor.outputDelimiter( currentSavedOutput, currentOutputInterceptor.getDelimiterNamespaceURI(), currentOutputInterceptor.getDelimiterPrefix(), currentOutputInterceptor.getDelimiterLocalName(), "xforms-case-begin-end", "xforms-case-end-" + XFormsUtils.namespaceId(containingDocument, effectiveId)); } else { // Output start and end delimiter using xhtml:span final String xhtmlPrefix = handlerContext.findXHTMLPrefix(); currentOutputInterceptor.outputDelimiter( currentSavedOutput, XMLConstants.XHTML_NAMESPACE_URI, xhtmlPrefix, "span", "xforms-case-begin-end", "xforms-case-begin-" + XFormsUtils.namespaceId(containingDocument, effectiveId)); currentOutputInterceptor.outputDelimiter( currentSavedOutput, XMLConstants.XHTML_NAMESPACE_URI, xhtmlPrefix, "span", "xforms-case-begin-end", "xforms-case-end-" + XFormsUtils.namespaceId(containingDocument, effectiveId)); } } } else if (!isVisible) { // Case not visible, restore output controller.setOutput(currentSavedOutput); } }
@Override public void handleControlEnd( String uri, String localname, String qName, Attributes attributes, String effectiveId, XFormsControl control) throws SAXException { final ElementHandlerController controller = handlerContext.getController(); if (!handlerContext.isNoScript()) { // Restore output controller.setOutput(currentSavedOutput); // Delimiter: end repeat outputInterceptor.flushCharacters(true, true); final boolean isMustGenerateBeginEndDelimiters = !handlerContext.isFullUpdateTopLevelControl(effectiveId); if (isMustGenerateBeginEndDelimiters) { outputInterceptor.outputDelimiter( currentSavedOutput, outputInterceptor.getDelimiterNamespaceURI(), outputInterceptor.getDelimiterPrefix(), outputInterceptor.getDelimiterLocalName(), "xforms-group-begin-end", "group-end-" + XFormsUtils.namespaceId(containingDocument, effectiveId)); } } else if (isNonRelevant(control)) { // In noscript, group was not visible, restore output controller.setOutput(currentSavedOutput); } // Don't support help, alert, or hint! }