for (QName item : sequence) {
if (!particles.containsKey(item)) {
if (context.getHandler().callback(ConflictHandler.Event.CREATION, ConflictHandler.Type.ELEMENT, item,
context.getPath() + "/" + item.getLocalPart(), "Element has undeclared child element.")) {
if (item.getNamespaceURI().equals(schema.getNamespace())) {
Particle element = Particle.Factory.newElementInstance(schema, item.getLocalPart());
if (completed) {
element.setAttribute("minOccurs", "0");
}
particles.put(item, element);
} else {
Schema otherSchema = context.getSchemaSystem().getSchemaForNamespace(item.getNamespaceURI());
schema.putPrefixForNamespace(item.getPrefix(), item.getNamespaceURI());
if (otherSchema == null) {
otherSchema = context.getSchemaSystem().newSchema(item.getNamespaceURI());
}
Particle ref = otherSchema.getParticle(item.getLocalPart());
if (ref == null) {
ref = otherSchema.newElement(item.getLocalPart());
}
if (completed) {
ref.setAttribute("minOccurs", "0");
}
particles.put(item, Particle.Factory.newReferenceInstance(schema, ref));
}
} else {
return false;