AS6: Control order of CompoundWidget property attributes in generated Content XML

Hi,

I noticed a difference between AS4 and AS6 regarding the generated Content XML of CompoundWidgets.

Environment:

  • AS4: 4.12.5.95 SP / mapp View: 5.24.3
  • AS6: 6.5.3.11 SP / mapp View: 6.8.0
  • Reproducible with multiple CompoundWidgets

For testing, I created a very simple CompoundWidget with two custom properties:

<Property xsi:type="NonBindableProperty"
          name="Property1"
          type="Number"
          defaultValue="1"
          required="true">
    <Mappings>
        <Mapping widget="no1" property="value" />
    </Mappings>
</Property>

<Property xsi:type="NonBindableProperty"
          name="Property2"
          type="Number"
          defaultValue="2"
          required="true">
    <Mappings>
        <Mapping widget="no2" property="value" />
    </Mappings>
</Property>

In AS4, when an instance of the CompoundWidget is created, the generated Content XML contains:

<Widget xsi:type="widgets.widgetlibrary_1.compoundwidget_0"
        id="compoundwidget_01"
        top="600"
        left="580"
        zIndex="11"
        Property1="1"
        Property2="2" />

In AS6, the generated XML contains:

<Widget xsi:type="widgets.widgetlibrary_0.compoundwidget_0"
        id="compoundwidget_01"
        top="600"
        left="300"
        zIndex="16"
        Property2="2"
        Property1="1" />

The properties Property1 and Property2 are now swapped.
Interestingly, this happens immediately after dragging the widget from the toolbox into the WYSIWYG editor. No property modification is required.

Additional observations:

  • Widget functionality is identical.
  • The Property Grid displays the properties in the expected order (Property1, Property2).
  • The effect is visible only in the generated XML.
  • The behavior is reproducible with several CompoundWidgets.
  • At first glance, the ordering appears to be reverse alphabetical, although I have not fully verified this yet.

I understand that XML attribute order is generally semantically irrelevant. However, from a maintainability perspective I would prefer a deterministic and, ideally, configurable ordering.
We use far more than two properties in our CompoundWidgets.

My questions are:

  1. What determines the order of custom CompoundWidget properties in AS6?
  2. Is the XML attribute order intentionally different from AS4?
  3. Is there any supported way to influence the generated attribute order?
  4. Can the order be defined explicitly in the CompoundWidget definition?
  5. Is there a way to enforce alphabetical ordering?
  6. Has anyone found a solution or workaround to keep XML diffs cleaner in Git/SVN and XML comparison tools?

The reason I am asking is that I occasionally inspect visualization settings directly in the XML. Different attribute ordering also creates unnecessary diffs when comparing projects, reviewing changes, or migrating projects from AS4 to AS6.

Thank you very much for your input and experience.

Best regards,
Simon :slight_smile:

any comments there @hobi72?

well, as usual … :upside_down_face:

The XMLs are generated by our “object model” . While storing an XML the object model examines all objects and decides on how an object is to be persisted. As example: It removes all properties which are set to default and persists only attributes which have been changed (compared to the default). As this is not a standard behavior of an XML serializer, we use our own, which is tailored to our special needs here.

How the XML looks like is mainly determined by our internal serialization engine.

The order of the XML attributes was not changed intentionally - but with the switch to mapp View 6 we change a lot in the handling of the objects, it is easily possible that due to some sorting, filtering, … the order changed.

The generation of the XML cannot be changed from outside - and there is also no function to define a “sort order” for attributes in the XML, so it is not possible to force a certain order. As written above - for pure XML the order of the attributes is irrelevant.

Prop. not what people want to hear - but this is the status q.

Hobi

Hi @hobi72 ,

thank you for the clarification.

That fully answers my question and saves me from further testing. I was hoping there might be a way to influence the serialization order, but I understand that this is currently determined internally by the object model.

Thanks for taking the time to explain the background.

Best regards,
Simon :slightly_smiling_face: