Hi Hussein,

Thanks for answering all the questions I've submitted over the past few
days. And I promise to start using the public mailing list for my
questions :-) But, since we're on the subject of "lenient" mode...

I appreciate that XXE lets me open an invalid template and then insert a
child to make it valid. And the interface does make it clear that there
is something wrong with the dita element. My problem is that: a)
inserting the first child--which should make the empty dita element
valid--doesn't try to enforce validity on that first child; b) lenient
mode evidently doesn't display elementTemplates in the picklist.

Again, when I insert a second child into to the dita tags, that child is
inserted with the required first child (title) and with the id attribute
highlighted as required. Why doesn't this happen when I insert the first
child? I tried to get around the problem by creating valid
elementTemplates for each of those children (using
selectable="override"), thinking that these would be what the user would
be allowed to choose from and insert. But the elementTemplates aren't
available in the pick list until lenient mode is off, I guess?

Mark



-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Thursday, March 23, 2006 1:56 AM
To: Mark Fletcher
Cc: xmleditor-support at xmlmind.com
Subject: Re: ditabase.dtd bug

Mark Fletcher wrote:
>  
> I'm seeing weird behavior when I create a new file based on the
> ditabase.dtd: 
>  
> 
>     * I create the file from a template which just contains
<dita></dita>
>     * In the pick list to insert elements, I see the four valid
choices
>       (concept, reference, task, topic), plus a grayed-out asterisk.
>     * When I insert one of the elements, it is inserted invalidly:
>       required attributes (id) and children (title) are not
>       automatically inserted.  All validation on that element then
seems
>       to be broken because can insert all of that element's child
>       elements in any order, any number of times.
>     * If I then insert another child into dita, that child's
validation
>       is fine.
> However if, after inserting the first child into dita, I provide that 
> child's required child element (a title), XXE starts behaving normally

> again.

You have perfectly described XXE's lenient mode, one of its most
advanced features.



> It appears that there's a problem handling dita's "one or more"
> definition: <!ELEMENT dita (topic|task|reference|concept)+ >
>  

Dear sir, do you really think after all those years, XXE has problems
handling "one or more" content models?

A template which only contains "<dita></dita>" is an *invalid* element
template. In this case, XXE works in lenient mode[*] until the invalid
element is fixed.

In summary, with XXE, garbage in (your template) means garbage out
(XXE's lenient mode).



---
[*] In the node path bar, word "dita" is underlined in orange which
means "I'm in lenient mode".

Plus, the validity icon is "red" and the validity tool says: "the
sequence of child elements is incorrect [cvc-complex-type.2.4]".

Therefore it is hard to not to notice there is something wrong with your
document.

---
PS: Please, please, always use the public support mailing list.




Reply via email to