Alain Pierrot wrote:
> 
> I meet a problem with XMLeditor:
> 
> If a DTD contains a structure requiring either an element (e.g. C) or a
> sequence of elements (e.g. (A, B)), XMLeditor seems to allow only the
> isolated element to be introduced.
> 
> Here is a sample DTD:
> 
> <!ELEMENT OUVRAGE (PARTIE+)>
> <!ELEMENT PARTIE ((A, B)| C)>
> <!ELEMENT A (#PCDATA)>
> <!ELEMENT B (#PCDATA)>
> <!ELEMENT C (#PCDATA)>
> 
> XMLeditor offers only <C> as part of <PARTIE>; I didn't find a way to be
> offered A, followed by B.
> Did I miss something?
> 
> Interestingly, XXE (under Windows) validates the following instance:
> <?xml version='1.0' encoding='ISO-8859-1'?>
> <!DOCTYPE OUVRAGE SYSTEM "file:/C:/Program
> Files/XMLmind_XML_Editor/dtd/DTD_pb/exemple.dtd">
> <OUVRAGE>
>   <PARTIE>
>     <A>A
>     </A>
>     <B>B
>     </B>
>   </PARTIE>
> </OUVRAGE>
> 
> but it prevents creating it unless you are in repair mode.

Everything you say is absolutely correct. You didn't miss anything: we
have missed something in the XXE M1.x prototype: how to deal with the
kind of construct you describe!

This is fixed in the product which will be released in Beta 1 this
month.

[1] There is a command named "Forced Deletion" which can be used to
delete C inside a newly created PARTIE.
[2] In the now empty PARTIE, insert a A then a B.

Note that in the product there is no explicit repair mode. The user is
allowed to work temporarily on an invalid document. The switch from
valid mode to ``hidden repair mode'' is seamless and happens on a
per-element basis.

More elegantly, you can define a named element template in XXE
configuration file (specific to your DTD) where an newly created PARTIE
contains A,B rather than C.

Meanwhile, in the XXE M1.x prototype, you can play with the Edit Tab
cryptic option: "When a new element is created..." (see
Options->Options) a try. This will create a PARTIE with A,B rather than
C (the default behavior is to use the simplest construct). But then, how
to create a PARTIE with just C? :-)

Reply via email to