// validation should fail, this is being side stepped for now until
// a good way of handling the namespace attributes on the root
// element, for now we just ignore attributes we dont find in the
// schema
if (decl != null) {
AttributeInstance att = new AttributeImpl(decl);
att.setNamespace(decl.getTargetNamespace());
att.setName(decl.getName());
att.setText(attributes.getValue(i));
atts.add(att);
} else {
parser.getLogger().warning("Could not find attribute declaration: " + attQName);
}
}
//create the element
element = new ElementImpl(content);
element.setNamespace(qName.getNamespaceURI());
element.setName(qName.getLocalPart());
element.setAttributes((AttributeInstance[]) atts.toArray(new AttributeInstance[atts.size()]));
//create the parse tree for the node
node = new NodeImpl(element);
//parse the attributes
for (int i = 0; i < element.getAttributes().length; i++) {
AttributeInstance attribute = element.getAttributes()[i];
ParseExecutor executor = new ParseExecutor(attribute, null, parent.getContext(), parser);
parser.getBindingWalker()
.walk(attribute.getAttributeDeclaration(), executor, parent.getContext());
Object parsed = executor.getValue();
node.addAttribute(new NodeImpl(attribute, parsed));
}