}
else {
// process the attributes
for (int i = 0; i < in.getAttributeCount(); i++) {
QName attributeName = in.getAttributeName(i);
XmlMapping mapping = getAttributeMapping(attributeName);
if (mapping == null)
throw new UnmarshalException(L.l("Attribute {0} not found in {1}",
attributeName, getType()));
mapping.readAttribute(in, i, ret);
}
int i = 0;
in.nextTag();
while (in.getEventType() == in.START_ELEMENT) {
XmlMapping mapping = getElementMapping(in.getName());
if (mapping == null) {
throw new UnmarshalException(L.l("Child <{0}> not found in {1}",
in.getName(), getType()));
}
if (! mapping.getAccessor().checkOrder(i++, u.getEventHandler())) {
throw new UnmarshalException(L.l("Child <{0}> misordered in {1}",
in.getName(), getType()));
}
mapping.read(u, in, ret);
}
// essentially a nextTag() that handles end of document gracefully
while (in.hasNext()) {
in.next();