Alex Milowski wrote: > > Here is a schema (and its parts) and an instance the demonstrates the > problem.
I have tested what you sent me. (I commented out the "import pseudocode.xsd" because you forgot to send me pseudocode.xsd). The error messages are very clear: [1] the sequence of child elements is incorrect [cvc-complex-type.2.4] [2] element cannot contain element "md:author" [cvc-complex-type] And clicking on [1] or on [2] allows the user to select the erroneous md:prolog. > If you select the 'pubdate' element and select 'insert after', you will > be given > all the children of 'md:prolog'--including 'pubdate'--which is not > really valid. > While I agree that XXE 2.5 is not "bad" in what it does give, in this > case, I > expected it to at least give the list of siblings that can legally > follow the > 'pubdate' element. That's true, but this is the intended behavior. When a element such as md:prolog is found to be invalid, its content model is temporarily ``relaxed'' in order to let the user remove or add any possible child element (any number of occurrences will do) and/or remove or add any possible attribute. We have chosen to implement the following strategy: When an element is invalid, do not try to constrain the user trying to fix this element, *because, in complex cases, trying to constrain the user will almost certainly prevent him from fixing the problem*. Example: A must contain B or C+D. We have this invalid A: <A><B/><D/></A>. User1 wants to fix this by adding C first and then by removing B. User2 wants to remove B first and then to add C. User3 wants to remove D. > To make this content valid, the 'md:author' element in the instance > needs to > become 'author' (unqualified with a namespace). Thus, converting it to > 'author' works great. > > Once the document becomes valid, 'pubdate' is selected, and 'insert > after' is > chosen, the right set of insert elements is given. Yes. The ``relaxed'' content model of md:prolog is dynamically and automatically replaced by the actual one, as soon as this is possible.

