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.

For that, I created an XHTML page with a <head> containing a <title> and 
a <meta>.

Then, using a text editor, I removed the <title> inside the <head> and 
reloaded the document in XXE. <head> was found to be invalid (because a 
<title> is required here).

After selecting the <meta> and clicking on "Insert After", XXE suggested 
to insert <script>, <link>, <title>, <meta>, <base>, <object>, <style> 
(that is, all valid siblings of <meta>).

Moreover, from XXE V2.5, authors can use "Help|Show Content Model" when 
they don't know the schema or DTD.

Once again XXE is not perfect when dealing with close-but-invalid 
documents but I wouldn't say that XXE is ridiculous.


Reply via email to