What you describe is an intrinsic limitation[*] of XXE which exists
since its inception (including in v3.8[**]).

I'm sorry but we do not intend to remove this limitation[***].

Here's what happens:

A valid Test element = Sub1 + Sub2 + [ SubSub1 + SubSub2 ]*
That is, in a Test element, a Sub2 must be followed by 0 or more
SubSub1+SubSub2 *pairs*.

Like all the other Edit commands, command insert can only insert one
element at a time. Inserting just a SubSub1 after a Sub2 would create an
invalid Test element. Therefore command insert cannot suggest to do this.

There is no real workaround[****] for this problem: XXE is simply *not*
*usable* with this kind of schema.

Note that a very similar problem is described here:
"XMLmind XML Editor - Support of RELAX NG Schemas", "Other content
models which are not XXE-friendly", "Example 2. Not specific to RELAX
NG" --
http://www.xmlmind.com/xmleditor/_distrib/doc/rngsupport/friendly_content_models.html#unfriendly_content_models



---
[*] You are welcome to call it a bug if you prefer.

[**] If it works in XXE v3.8 as you said, then it is a *bug* in XXE v3.8
because in such case, the insert command would allow to create a
structurally invalid document.

[***] Always for the same reason: this limitation makes XXE
implementation simpler/faster/more reliable and removing this limitation
would not make XXE significantly more useful. Note that XXE probably has
*dozens* of other limitations like this one.

[****] Given a valid Test element,
[a] Use "Edit|Force Deletion" to delete the Sub2 child.
[b] This makes the Test element invalid: XXE automatically switches to
lenient editing mode.
[c] Insert any element you want in the broken Test element, including
SubSub1 then SubSub2.
[d] Insert a Sub2 child at its right position.
[e] The Test element is valid again and contains the proper
SubSub1+SubSub2 pairs.

Yes, in practice, this makes XXE unusable with this kind of content model.



Ulrich_Laegeler at arburg.com wrote:
> 
> Now i have a problem with a schema sequence being a child of a sequence
> Have a look at the following schema.
> 
> If i select the element Sub2 in a instance document in Xmlmind
> i cannot add a SubSub1 element with the insert after command.
> 
> I think Xmlmind has problems with such a subsequence.
> 
> Is this a bug or a limitation :-)
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="
> qualified" attributeFormDefault="unqualified">
>     <xs:element name="Test">
>         <xs:annotation>
>             <xs:documentation>Comment describing your root element</
> xs:documentation>
>         </xs:annotation>
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Sub1">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element name="Sub1Sub"/>
>                         </xs:sequence>
>                     </xs:complexType>
>                 </xs:element>
>                 <xs:element name="Sub2"/>
>                 <xs:sequence minOccurs="0" maxOccurs="unbounded">
>                     <xs:element name="SubSub1"/>
>                     <xs:element name="SubSub2"/>
>                 </xs:sequence>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> 


Reply via email to