Ok, that's reasonable.
But what's about to add a [force] parameter to the "insert" command like the
"delete" command has one?
|------------>
| Von: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Hussein Shafie <hussein at xmlmind.com>
|
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| An: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Ulrich_Laegeler at arburg.com
|
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Kopie: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|"xmleditor-support at xmlmind.com" <xmleditor-support at xmlmind.com>
|
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Datum: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|25.01.2010 14:56
|
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Betreff: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Re: [XXE] Subsequence
|
>------------------------------------------------------------------------------------------------------------------------------------------------------------|
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>
>
ARBURG GmbH + Co KG, Postfach 1109, D-72286 Lo?burg, Arthur-Hehl-Strasse,
D-72290 Lossburg, Telefon: 07446 33-0, Telefax: 07446 33-3365,
http://www.arburg.com, contact at arburg.com.
Registergericht: AG Stuttgart, HRA 430209, USt-Id-Nr. DE 144 252 064,
Komplement?r: Hehl Verwaltungs-GmbH, AG Stuttgart, HRB 430155. Gesch?ftsf?hrer:
Eugen Hehl, Karl Hehl, Michael Hehl, Juliane Hehl, Renate Keinath, Herbert
Kraib?hler, Michael Grandt, Helmut Heinson.
Diese E-Mail einschlie?lich ihrer Anh?nge ist vertraulich und daher allein f?r
den Gebrauch durch den vorgesehenen Empf?nger bestimmt. Dritten ist das Lesen,
Verteilen oder Weiterleiten dieser E-Mail nur mit ausdr?cklicher Zustimmung
erlaubt. Wir bitten, eine fehlgeleitete E-Mail unverz?glich vollst?ndig zu
l?schen und uns eine Nachricht zukommen zu lassen. Sofern diese E-Mail oder
ihre Anh?nge Informationen enthalten, die erkennbar von Dritten stammen,
?bernimmt ARBURG GmbH + Co KG, die Gliederungen und T?chter keine Haftung f?r
diese. Insbesondere macht sich ARBURG GmbH + Co KG diese Informationen nicht zu
Eigen.
This email may contain material that is confidential, privileged and for the
sole use of the intended recipient. Any review, reliance or distribution by
others or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies. ARBURG GmbH + Co KG, its branches and subsidiaries herewith exclude any
liability for third-party information recognizably contained in this e-mail or
its attachments. Third-party information does not necessarily reflect the
opinion of ARBURG GmbH + Co KG.