On Tuesday, November 18, 2003, at 07:27 AM, Hussein Shafie wrote: > Alex Milowski wrote: >> I've run into a problem that is somewhat annoying and is probably a >> common occurrence >> for most users. I changed my schema slightly so that one of the >> elements in my >> existing documents would be invalid. I opened the document in the >> editor and, of course, >> it identified those elements as invalid. What it didn't do is give >> me the correct >> choices for which elements to insert. >> For example, suppose I had an address element type which was very >> flexible and now >> I've constrained the type to enforce at least a city and state. So, >> if I had the >> content >> <address><city>Berkeley</city></address> >> I now want the option when I select the city element to give me the >> valid sibling >> choice of the 'state' element. >> Unfortunately, as the document is invalid, every possible child of >> address is given. >> Since I know the schema, I know which one to insert. If I was the >> average author, this >> might not be true. Thus, the editor fails to help me "do the right >> thing". >> I realize that the PSVI is totally useless when it comes to this kind >> of support as >> once the element is invalid you lose type information for the >> children. It would >> seem that, within reason, the editor should make a "best-effort" to >> give the correct >> options. There is probably some kind of attrition point where the >> return is minimal or >> the options available won't make anymore sense than what is currently >> implemented. >> Basically, being able to handle partially valid documents is going to >> be a success >> factor for content management. For example, suppose you are a >> publisher and you >> receive XML content from your authors. You know, on a regular basis, >> you are going >> to receive close-but-invalid content from your authors. Refusal of >> the content isn't >> always the best option. At least you need to notify the author >> something like: "you >> forgot the 'state' tag in your 'address' element." > > I have tried to reproduce your user experience.
Here is a schema (and its parts) and an instance the demonstrates the problem. 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. 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: ps.zip Type: application/zip Size: 5866 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20031119/8b5d36b5/attachment.zip -------------- next part -------------- A non-text attachment was scrubbed... Name: test.xml Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20031119/8b5d36b5/attachment.dll -------------- next part -------------- Alex Milowski FAX: (707) 598-7649 alex at milowski.com "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered." Bertrand Russell in a footnote of Principles of Mathematics

