Index: org/exolab/castor/xml/UnmarshalHandler.java =================================================================== --- org/exolab/castor/xml/UnmarshalHandler.java (Revision 6885) +++ org/exolab/castor/xml/UnmarshalHandler.java (Arbeitskopie) @@ -1771,14 +1771,6 @@ descriptor = classDesc.getFieldDescriptor(name, namespace, NodeType.Element); } - if (descriptor != null && isValidating()) { - try { - classDesc.checkDescriptorForCorrectOrderWithinSequence(descriptor, parentState, name); - } catch (ValidationException e) { - throw new SAXException(e); - } - } - //-- Namespace patch, should be moved to XMLClassDescriptor, but //-- this is the least intrusive patch at the moment. kv - 20030423 if ((descriptor != null) && (!descriptor.isContainer())) { @@ -1857,6 +1849,14 @@ isWrapper = (isWrapper || hasFieldsAtLocation(pathBuf.toString(), classDesc)); } + if (descriptor != null && isValidating()) { + try { + classDesc.checkDescriptorForCorrectOrderWithinSequence(descriptor, parentState, name); + } catch (ValidationException e) { + throw new SAXException(e); + } + } + //-- Make sure there are more parent classes on stack //-- otherwise break, since there is nothing to do //if (pIdx == 0) break;