dzhw / zofar

10 stars 1 forks source link

questionnaire_generated.xml - order should not be relevant #560

Open christian-fr opened 1 year ago

christian-fr commented 1 year ago

Status quo

When building a project, a file questionnaire_generated.xml is created, containing XML data from one or more files matching the regex: questionnaire[0-9]*\.xml

We observed different behaviour when reversing that order, e.g. (ex-)changing the filenames e.g.: questionnaire.xml -> questionnaire1.xml questionnaire1.xml -> questionnaire.xml

The resulting questionnaire_generated.xml files differ in size and structure.

A difference in XML-structure is to be expected, insofar as the order of the page-tags is determined by the order of declaration within the XML-files.

But structural differences apart from that must not happen. A different filesize is an indicator of larger structural differences.

Analysis

Further inspection revealed, that the only noticeable differences between those files seem to be automatically added attributes and tags.

attributes:

additionalLanguages="" customLayout="false"

tags:

<zofar:side xsi:nil="true"/> <zofar:researchdata xsi:nil="true"/> <zofar:breadcrumb xsi:nil="true"/> <zofar:triggers xsi:nil="true"/> <zofar:header xsi:nil="true"/> <zofar:transitions xsi:nil="true"/> <zofar:body xsi:nil="true"/>

Example: page "end_0"

When situated in questionnaire.xml, the resulting element in questionnaire_generated.xml looks like this:

    <zofar:page uid="end_0">
        <zofar:body uid="b">
            <zofar:section uid="sc">
                <zofar:body uid="b">
                    <zofar:questionOpen uid="qo" variable="mis200" smallOption="false">
                        <zofar:header>
                            <zofar:question uid="qo1" block="true">#{layout.BREAK}
                                #{layout.BREAK}
                                Wenn Sie noch Kommentare oder Anregungen haben, können Sie uns diese gerne hier mitteilen:</zofar:question>
                        </zofar:header>
                    </zofar:questionOpen>
                </zofar:body>
            </zofar:section>
        </zofar:body>
        <zofar:transitions>
            <zofar:transition target="end"/>
        </zofar:transitions>
    </zofar:page>

When situated in questionnaire1.xml, the resulting element in questionnaire_generated.xml looks like this:

    <zofar:page uid="end_0" additionalLanguages="" customLayout="false">
        <zofar:header xsi:nil="true"/>
        <zofar:body uid="b">
            <zofar:section uid="sc">
                <zofar:body uid="b">
                    <zofar:questionOpen uid="qo" variable="mis200" smallOption="false">
                        <zofar:header>
                            <zofar:question uid="qo1" block="true">#{layout.BREAK}
                                #{layout.BREAK}
                                Wenn Sie noch Kommentare oder Anregungen haben, können Sie uns diese gerne hier mitteilen:</zofar:question>
                        </zofar:header>
                    </zofar:questionOpen>
                </zofar:body>
            </zofar:section>
        </zofar:body>
        <zofar:transitions>
            <zofar:transition target="end"/>
        </zofar:transitions>
        <zofar:triggers xsi:nil="true"/>
        <zofar:side xsi:nil="true"/>
        <zofar:researchdata xsi:nil="true"/>
        <zofar:breadcrumb xsi:nil="true"/>
    </zofar:page>