List of usage examples for org.apache.commons.jxpath JXPathContext newContext
public static JXPathContext newContext(Object contextBean)
From source file:fr.cls.atoll.motu.library.misc.data.CatalogData.java
static public List<Object> findJaxbElementUsingJXPath(Object object, String xPath) { List<Object> listObjectFound = new ArrayList<Object>(); JXPathContext context = JXPathContext.newContext(object); context.setLenient(true);/* w w w. j a v a 2 s . c o m*/ // Object oo = // context.getValue("//threddsMetadataGroup[name='{http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0}serviceName']/value"); // Object oo = // context.getValue("//threddsMetadataGroup[name='{http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0}serviceName']/value"); // Iterator it = // context.iterate("//threddsMetadataGroup[name='{http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0}serviceName']/value"); Iterator<?> it = context.iterate(xPath); while (it.hasNext()) { listObjectFound.add(it.next()); } return listObjectFound; }
From source file:de.innovationgate.wgpublisher.hdb.HDBModel.java
/** * Retrieve the valid relation targets for a HDBModel relation * @param content The content having the relation or a parent content below which the model of this content is defined (in case the content does not yet exist) * @param contentClass The content class of the content for which the relation is defined * @param relation Name of the relation/* w w w. j ava2 s. c o m*/ * @param options Custom options for the retrieval. Use constants OPTION_... from this class or QUERYOPTION_... from {@link WGDatabase} * @return Result set of all valid relation targets * @throws WGException * @throws HDBModelException */ @CodeCompletion public WGAbstractResultSet getRelationTargets(WGContent content, String contentClass, String relation, Map options) throws WGException, HDBModelException { Document refNode = getModelForContent(content); if (refNode == null) { throw new HDBModelException("Cannot find model for content " + content.getContentKey() + " of class " + content.getContentClass()); } Content contentNode = null; if (refNode instanceof Content && (contentClass == null || contentClass.equals(((Content) refNode).getContentClass()))) { contentNode = (Content) refNode; } else if (refNode instanceof DocumentParent) { contentNode = findChildModelOfClass((DocumentParent) refNode, contentClass); if (contentNode == null) { throw new HDBModelException( "Cannot find direct child content class " + contentClass + " from ref document '" + content.getContentKey() + "' of class " + content.getContentClass()); } } JXPathContext jxPath = JXPathContext.newContext(contentNode); Relation relationNode = (Relation) jxPath.selectSingleNode("/relations[name='" + relation + "']"); if (relationNode == null) { throw new HDBModelException( "Cannot find relation '" + relation + "' for content class " + content.getContentClass()); } String extraClause = (String) options.get(OPTION_EXTRACLAUSE); Map extraParams = (Map) options.get(OPTION_EXTRAPARAMS); if (extraParams != null) { extraParams = new HashMap(extraParams); } Boolean includeCurrent = WGUtils.getBooleanMapValue(options, OPTION_INCLUDECURRENT, true); return getRelationTargets(content, contentClass, relationNode, extraClause, extraParams, includeCurrent, options); }
From source file:de.innovationgate.wgpublisher.hdb.HDBModel.java
private Filter getFilterNode(Document baseModel, String targetClass, String filter) { if (!(baseModel instanceof DocumentParent)) { return null; }//from w w w . j a v a 2 s.c o m Document model = findChildModelOfClass((DocumentParent) baseModel, targetClass); JXPathContext jxPath = JXPathContext.newContext(model); return (Filter) jxPath.selectSingleNode("/filters[name='" + filter + "']"); }
From source file:de.innovationgate.wgpublisher.hdb.HDBModel.java
/** * Retrieves the source contents for a HDBModel relation that point to a given content * @param target The content to which the relations point * @param contentClass The content class of the source contents to return. Specify null to return contents of all content classes. * @param relation The name of the relation that should point to the target content * @param options Custom options for the retrieval. Use constants OPTION_... from this class or QUERYOPTION_... from {@link WGDatabase} * @throws WGAPIException/*from ww w .ja v a2 s .c om*/ * @throws HDBModelException */ @CodeCompletion public WGAbstractResultSet getRelationSources(WGContent target, String contentClass, String relation, Map options) throws WGAPIException, HDBModelException { String extraClause = (String) options.get(OPTION_EXTRACLAUSE); Map extraParams = (Map) options.get(OPTION_EXTRAPARAMS); JXPathContext jxPath = JXPathContext.newContext(_definition); Relation relationNode = (Relation) jxPath.selectSingleNode( "//childContents[contentClass='" + contentClass + "']/relations[name='" + relation + "']"); if (relationNode == null) { throw new HDBModelException( "Cannot find relation '" + relation + "' for content class " + contentClass); } StringBuffer hql = new StringBuffer(); if (relationNode.isGroup()) { hql.append( "content.contentclass = :contentclass and :target in (select rel.target from ContentRelation as rel where rel.parentcontent = content and rel.group=:relname)"); } else { hql.append("content.contentclass = :contentclass and content.relations[:relname].target = :target"); } if (extraClause != null) { // Extract an optional order by clause from the extra clause String extraClauseOrderClause = null; int whereClauseEndIdx = extraClause.toLowerCase().indexOf("order by"); if (whereClauseEndIdx != -1) { extraClauseOrderClause = extraClause.substring(whereClauseEndIdx + 8); extraClause = extraClause.substring(0, whereClauseEndIdx); } if (!extraClause.trim().isEmpty()) { hql.append(" AND (" + extraClause + ")"); } if (extraClauseOrderClause != null) { hql.append(" ORDER BY ").append(extraClauseOrderClause); } } Map queryParams = new HashMap(); queryParams.put("contentclass", contentClass); queryParams.put("relname", relation); queryParams.put("target", target); if (extraParams != null) { queryParams.putAll(extraParams); } Map parameters = new HashMap(); parameters.put(WGDatabase.QUERYOPTION_QUERY_PARAMETERS, queryParams); // Transport regular query parameters to the internal query migrateQueryParameter(WGDatabase.QUERYOPTION_CACHERESULT, options, queryParams); migrateQueryParameter(WGDatabase.QUERYOPTION_ROLE, options, queryParams); migrateQueryParameter(WGDatabase.QUERYOPTION_MAXRESULTS, options, queryParams); migrateQueryParameter(WGDatabase.QUERYOPTION_EXCLUDEDOCUMENT, options, queryParams); migrateQueryParameter(WGDatabase.QUERYOPTION_ENHANCE, options, queryParams); migrateQueryParameter(WGDatabase.QUERYOPTION_ONLYRELEASED, options, queryParams); WGAbstractResultSet resultSet = _db.query("hql", hql.toString(), parameters); // Migrate output parameters back try { migrateQueryParameter(WGDatabase.QUERYOPTION_RETURNQUERY, parameters, options); } catch (UnsupportedOperationException e) { // Silently ignore if options map is unmodifiable } return resultSet; }
From source file:nl.clockwork.mule.common.filter.JXPathFilter.java
@Override public boolean accept(MuleMessage message) { try {//from ww w. j a v a2s . c o m JXPathContext context = JXPathContext.newContext(message.getPayload()); String s = context.getValue(xPathQuery).toString(); return s.matches(regEx); } catch (Exception e) { return false; } }
From source file:nl.clockwork.mule.common.filter.ObjectExistsFilter.java
@Override public boolean accept(MuleMessage message) { JXPathContext context = JXPathContext.newContext(message.getPayload()); return context.getValue(xPathQuery) != null; }
From source file:nz.org.take.r2ml.util.TypeVariablesFilter.java
public void repair(RuleBase ruleBase) throws R2MLException { JXPathContext context = JXPathContext.newContext(ruleBase); ObjectFactory of = new ObjectFactory(); // search objectclassificationatoms that contain untyped variables context = JXPathContext.newContext(ruleBase); Iterator implicitTypedVars = context.iterate( "//qfAndOrNafNegFormula" + "[declaredType='class de.tu_cottbus.r2ml.ObjectClassificationAtom']" + "[value/objectTerm/declaredType='class de.tu_cottbus.r2ml.ObjectVariable']" + "[not(value/objectTerm/value/classID)]" + "/value"); while (implicitTypedVars.hasNext()) { try {/*w w w.j a v a2 s .co m*/ ObjectClassificationAtom classification = (ObjectClassificationAtom) implicitTypedVars.next(); ObjectVariable var = (ObjectVariable) classification.getObjectTerm().getValue(); ObjectVariable newVar = of.createObjectVariable(); newVar.setName(var.getName()); newVar.setTypeCategory(var.getTypeCategory()); newVar.setClassID(classification.getClassID()); classification.setObjectTerm(of.createObjectVariable(newVar)); } catch (RuntimeException e) { if (R2MLDriver.get().logger.isDebugEnabled()) R2MLDriver.get().logger.debug("Exception occured while typing all variables.", e); throw new R2MLException("Unable to type variables in rule base, abort rule import."); } } // search already typed variables and save them in a hash-map Iterator typedVar = context .iterate("//objectTerm[declaredType='class de.tu_cottbus.r2ml.ObjectVariable']/value[classID]");// ce.iterate(context); Map<String, QName> classID4name = new HashMap<String, QName>(); while (typedVar.hasNext()) { try { ObjectVariable element = (ObjectVariable) typedVar.next(); classID4name.put(element.getName(), element.getClassID()); } catch (RuntimeException e) { } } // search all untyped variables and look up the types in the classId // hashmap Iterator untypedVar = context.iterate( "//objectTerm[declaredType='class de.tu_cottbus.r2ml.ObjectVariable']/value[not(classID)]"); while (untypedVar.hasNext()) { ObjectVariable element = (ObjectVariable) untypedVar.next(); QName classID = classID4name.get(element.getName()); if (classID != null) { element.setClassID(classID); } } }
From source file:org.alfresco.web.forms.xforms.Schema2XForms.java
@SuppressWarnings("unchecked") public static void rebuildInstance(final Node prototypeNode, final Node oldInstanceNode, final Node newInstanceNode, final HashMap<String, String> schemaNamespaces) { final JXPathContext prototypeContext = JXPathContext.newContext(prototypeNode); prototypeContext.registerNamespace(NamespaceService.ALFRESCO_PREFIX, NamespaceService.ALFRESCO_URI); final JXPathContext instanceContext = JXPathContext.newContext(oldInstanceNode); instanceContext.registerNamespace(NamespaceService.ALFRESCO_PREFIX, NamespaceService.ALFRESCO_URI); for (final String prefix : schemaNamespaces.keySet()) { prototypeContext.registerNamespace(prefix, schemaNamespaces.get(prefix)); instanceContext.registerNamespace(prefix, schemaNamespaces.get(prefix)); }//from w ww . j av a2s . co m // Evaluate non-recursive XPaths for all prototype elements at this level final Iterator<Pointer> it = prototypeContext.iteratePointers("*"); while (it.hasNext()) { final Pointer p = it.next(); Element proto = (Element) p.getNode(); String path = p.asPath(); // check if this is a prototype element with the attribute set boolean isPrototype = proto.hasAttributeNS(NamespaceService.ALFRESCO_URI, "prototype") && proto.getAttributeNS(NamespaceService.ALFRESCO_URI, "prototype").equals("true"); // We shouldn't locate a repeatable child with a fixed path if (isPrototype) { path = path.replaceAll("\\[(\\d+)\\]", "[position() >= $1]"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("[rebuildInstance] evaluating prototyped nodes " + path); } } else { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[rebuildInstance] evaluating child node with positional path " + path); } } Document newInstanceDocument = newInstanceNode.getOwnerDocument(); // Locate the corresponding nodes in the instance document List<Node> l = (List<Node>) instanceContext.selectNodes(path); // If the prototype node isn't a prototype element, copy it in as a missing node, complete with all its children. We won't need to recurse on this node if (l.isEmpty()) { if (!isPrototype) { LOGGER.debug("[rebuildInstance] copying in missing node " + proto.getNodeName() + " to " + XMLUtil.buildXPath(newInstanceNode, newInstanceDocument.getDocumentElement())); // Clone the prototype node and all its children Element clone = (Element) proto.cloneNode(true); newInstanceNode.appendChild(clone); if (oldInstanceNode instanceof Document) { // add XMLSchema instance NS addNamespace(clone, NamespaceConstants.XMLSCHEMA_INSTANCE_PREFIX, NamespaceConstants.XMLSCHEMA_INSTANCE_NS); } } } else { // Otherwise, append the matches from the old instance document in order for (Node old : l) { Element oldEl = (Element) old; // Copy the old instance element rather than cloning it, so we don't copy over attributes Element clone = null; String nSUri = oldEl.getNamespaceURI(); if (nSUri == null) { clone = newInstanceDocument.createElement(oldEl.getTagName()); } else { clone = newInstanceDocument.createElementNS(nSUri, oldEl.getTagName()); } newInstanceNode.appendChild(clone); if (oldInstanceNode instanceof Document) { // add XMLSchema instance NS addNamespace(clone, NamespaceConstants.XMLSCHEMA_INSTANCE_PREFIX, NamespaceConstants.XMLSCHEMA_INSTANCE_NS); } // Copy over child text if this is not a complex type boolean isEmpty = true; for (Node n = old.getFirstChild(); n != null; n = n.getNextSibling()) { if (n instanceof Text) { clone.appendChild(newInstanceDocument.importNode(n, false)); isEmpty = false; } else if (n instanceof Element) { break; } } // Populate the nil attribute. It may be true or false if (proto.hasAttributeNS(NamespaceConstants.XMLSCHEMA_INSTANCE_NS, "nil")) { clone.setAttributeNS(NamespaceConstants.XMLSCHEMA_INSTANCE_NS, NamespaceConstants.XMLSCHEMA_INSTANCE_PREFIX + ":nil", String.valueOf(isEmpty)); } // Copy over attributes present in the prototype NamedNodeMap attributes = proto.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Attr attribute = (Attr) attributes.item(i); String localName = attribute.getLocalName(); if (localName == null) { String name = attribute.getName(); if (oldEl.hasAttribute(name)) { clone.setAttributeNode( (Attr) newInstanceDocument.importNode(oldEl.getAttributeNode(name), false)); } else { LOGGER.debug("[rebuildInstance] copying in missing attribute " + attribute.getNodeName() + " to " + XMLUtil.buildXPath(clone, newInstanceDocument.getDocumentElement())); clone.setAttributeNode((Attr) attribute.cloneNode(false)); } } else { String namespace = attribute.getNamespaceURI(); if (!((!isEmpty && (namespace.equals(NamespaceConstants.XMLSCHEMA_INSTANCE_NS) && localName.equals("nil")) || (namespace.equals(NamespaceService.ALFRESCO_URI) && localName.equals("prototype"))))) { if (oldEl.hasAttributeNS(namespace, localName)) { clone.setAttributeNodeNS((Attr) newInstanceDocument .importNode(oldEl.getAttributeNodeNS(namespace, localName), false)); } else { LOGGER.debug("[rebuildInstance] copying in missing attribute " + attribute.getNodeName() + " to " + XMLUtil.buildXPath(clone, newInstanceDocument.getDocumentElement())); clone.setAttributeNodeNS((Attr) attribute.cloneNode(false)); } } } } // recurse on children rebuildInstance(proto, oldEl, clone, schemaNamespaces); } } // Now add in a new copy of the prototype if (isPrototype) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[rebuildInstance] appending " + proto.getNodeName() + " to " + XMLUtil.buildXPath(newInstanceNode, newInstanceDocument.getDocumentElement())); } newInstanceNode.appendChild(proto.cloneNode(true)); } } }
From source file:org.alfresco.web.forms.xforms.Schema2XForms.java
private void addAttributeSet(final Document xformsDocument, final Element modelSection, final Element defaultInstanceElement, final Element formSection, final XSModel schema, final XSComplexTypeDefinition controlType, final XSElementDeclaration owner, final String pathToRoot, final boolean checkIfExtension, final ResourceBundle resourceBundle) throws FormBuilderException { XSObjectList attrUses = controlType.getAttributeUses(); if (attrUses == null) { return;/*from w ww . ja v a 2 s . c o m*/ } for (int i = 0; i < attrUses.getLength(); i++) { final XSAttributeUse currentAttributeUse = (XSAttributeUse) attrUses.item(i); final XSAttributeDeclaration currentAttribute = currentAttributeUse.getAttrDeclaration(); String attributeName = currentAttributeUse.getName(); if (attributeName == null || attributeName.length() == 0) { attributeName = currentAttributeUse.getAttrDeclaration().getName(); } //test if extended ! if (checkIfExtension && SchemaUtil.doesAttributeComeFromExtension(currentAttributeUse, controlType)) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( "[addAttributeSet] This attribute comes from an extension: recopy form controls. Model section =\n" + XMLUtil.toString(modelSection)); } //find the existing bind Id //(modelSection is the enclosing bind of the element) final NodeList binds = modelSection.getElementsByTagNameNS(NamespaceConstants.XFORMS_NS, "bind"); String bindId = null; for (int j = 0; j < binds.getLength() && bindId == null; j++) { Element bind = (Element) binds.item(j); String nodeset = bind.getAttributeNS(NamespaceConstants.XFORMS_NS, "nodeset"); if (nodeset != null) { //remove "@" in nodeset String name = nodeset.substring(1); if (name.equals(attributeName)) { bindId = bind.getAttributeNS(null, "id"); } } } //find the control Element control = null; if (bindId != null) { if (LOGGER.isDebugEnabled()) LOGGER.debug("[addAttributeSet] bindId found: " + bindId); JXPathContext context = JXPathContext.newContext(formSection.getOwnerDocument()); final Pointer pointer = context .getPointer("//*[@" + NamespaceConstants.XFORMS_PREFIX + ":bind='" + bindId + "']"); if (pointer != null) { control = (Element) pointer.getNode(); } else if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addAttributeSet] unable to resolve pointer for: //*[@" + NamespaceConstants.XFORMS_PREFIX + ":bind='" + bindId + "']"); } } if (LOGGER.isDebugEnabled()) { if (control == null) { LOGGER.debug("[addAttributeSet] control = <not found>"); } else { LOGGER.debug("[addAttributeSet] control = " + control.getTagName()); } } //copy it if (control == null) { if (LOGGER.isDebugEnabled()) LOGGER.debug("Corresponding control not found"); } else { Element newControl = (Element) control.cloneNode(true); //set new Ids to XForm elements this.resetXFormIds(newControl); formSection.appendChild(newControl); } } else { String attrNamespace = currentAttribute.getNamespace(); String namespacePrefix = ""; if (attrNamespace != null && attrNamespace.length() > 0) { String prefix = NamespaceResolver.getPrefix(xformsDocument.getDocumentElement(), attrNamespace); if (prefix != null && prefix.length() > 0) { namespacePrefix = prefix + ":"; } } final String newPathToRoot = (pathToRoot == null || pathToRoot.length() == 0 ? "@" + namespacePrefix + currentAttribute.getName() : (pathToRoot.endsWith("/") ? pathToRoot + "@" + namespacePrefix + currentAttribute.getName() : pathToRoot + "/@" + namespacePrefix + currentAttribute.getName())); if (LOGGER.isDebugEnabled()) LOGGER.debug("[addAttributeSet] adding attribute " + attributeName + " at " + newPathToRoot); try { String defaultValue = (currentAttributeUse.getConstraintType() == XSConstants.VC_NONE ? null : currentAttributeUse.getConstraintValue()); // make sure boolean attributes have a default value if (defaultValue == null && "boolean".equals(currentAttribute.getTypeDefinition().getName())) { defaultValue = "false"; } if (namespacePrefix.length() > 0) { defaultInstanceElement.setAttributeNS(this.targetNamespace, attributeName, defaultValue); } else { defaultInstanceElement.setAttribute(attributeName, defaultValue); } } catch (Exception e) { throw new FormBuilderException("error retrieving default value for attribute " + attributeName + " at " + newPathToRoot, e); } this.addSimpleType(xformsDocument, modelSection, formSection, schema, currentAttribute.getTypeDefinition(), currentAttributeUse, newPathToRoot, resourceBundle); } } }
From source file:org.alfresco.web.forms.xforms.Schema2XForms.java
/** *//*from ww w . j av a2 s . c o m*/ private void addGroup(final Document xformsDocument, final Element modelSection, final Element defaultInstanceElement, final Element formSection, final XSModel schema, final XSModelGroup group, final XSComplexTypeDefinition controlType, final XSElementDeclaration owner, final String pathToRoot, final SchemaUtil.Occurrence occurs, final boolean checkIfExtension, final ResourceBundle resourceBundle) throws FormBuilderException { if (group == null) { return; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] Start of addGroup, from owner = " + owner.getName() + " and controlType = " + controlType.getName()); LOGGER.debug("[addGroup] group before =\n" + XMLUtil.toString(formSection)); } final Element repeatSection = this.addRepeatIfNecessary(xformsDocument, modelSection, formSection, owner.getTypeDefinition(), pathToRoot, occurs); final XSObjectList particles = group.getParticles(); for (int counter = 0; counter < particles.getLength(); counter++) { final XSParticle currentNode = (XSParticle) particles.item(counter); XSTerm term = currentNode.getTerm(); final SchemaUtil.Occurrence childOccurs = new SchemaUtil.Occurrence(currentNode); if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] next term = " + term.getName() + ", occurs = " + childOccurs); } if (term instanceof XSModelGroup) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] term is a group"); } this.addGroup(xformsDocument, modelSection, defaultInstanceElement, repeatSection, schema, ((XSModelGroup) term), controlType, owner, pathToRoot, childOccurs, checkIfExtension, resourceBundle); } else if (term instanceof XSElementDeclaration) { XSElementDeclaration element = (XSElementDeclaration) term; if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] term is an element declaration: " + term.getName()); } //special case for types already added because used in an extension //do not add it when it comes from an extension !!! //-> make a copy from the existing form control if (checkIfExtension && SchemaUtil.doesElementComeFromExtension(element, controlType)) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( "[addGroup] This element comes from an extension: recopy form controls. Model Section =\n" + XMLUtil.toString(modelSection)); } //find the existing bind Id //(modelSection is the enclosing bind of the element) NodeList binds = modelSection.getElementsByTagNameNS(NamespaceConstants.XFORMS_NS, "bind"); String bindId = null; for (int i = 0; i < binds.getLength() && bindId == null; i++) { Element bind = (Element) binds.item(i); String nodeset = bind.getAttributeNS(NamespaceConstants.XFORMS_NS, "nodeset"); Pair<String, String> parsed = parseName(nodeset, xformsDocument); if (nodeset != null && EqualsHelper.nullSafeEquals(parsed.getSecond(), element.getNamespace()) && parsed.getFirst().equals(element.getName())) { bindId = bind.getAttributeNS(null, "id"); } } if (LOGGER.isDebugEnabled()) LOGGER.debug("[addGroup] found bindId " + bindId + " for element " + element.getName()); //find the control Element control = null; if (bindId != null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] bindId found: " + bindId); } final JXPathContext context = JXPathContext.newContext(formSection.getOwnerDocument()); final Pointer pointer = context .getPointer("//*[@" + NamespaceConstants.XFORMS_PREFIX + ":bind='" + bindId + "']"); if (pointer != null) { control = (Element) pointer.getNode(); } else if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] unable to resolve pointer for: //*[@" + NamespaceConstants.XFORMS_PREFIX + ":bind='" + bindId + "']"); } } if (LOGGER.isDebugEnabled()) { if (control == null) { LOGGER.debug("[addGroup] control = <not found>"); } else { LOGGER.debug("[addGroup] control = " + control.getTagName()); } } //copy it if (control == null) { if (LOGGER.isDebugEnabled()) LOGGER.debug("Corresponding control not found"); this.addElementToGroup(xformsDocument, modelSection, defaultInstanceElement, repeatSection, schema, element, pathToRoot, childOccurs, resourceBundle); } else { Element newControl = (Element) control.cloneNode(true); //set new Ids to XForm elements this.resetXFormIds(newControl); repeatSection.appendChild(newControl); } } else { this.addElementToGroup(xformsDocument, modelSection, defaultInstanceElement, repeatSection, schema, element, pathToRoot, childOccurs, resourceBundle); } } else { LOGGER.warn("Unhandled term " + term + " found in group from " + owner.getName() + " for pathToRoot = " + pathToRoot); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[addGroup] group after =\n" + XMLUtil.toString(formSection)); LOGGER.debug("[addGroup] End of addGroup, from owner = " + owner.getName() + " and controlType = " + controlType.getName()); } }