Skip to content

Bug in format of XML files: ambiguity between one-object and unnamed object properties #707

@chrisdembia

Description

@chrisdembia

We allow users to express single-value Object properties in two different ways in XML. For example, a property declared as OpenSim_DECLARE_PROPERTY(myfunc, GCVSpline, "comment"); can appear as:

<GCVSpline name="myfunc">
 ...
</GCVSpline>

or

<myfunc>
    <GCVSpline>
    ...
    </GCVSpline>
</myfunc>

This is explained on doxygen.

If I have an unnamed property OpenSim_DECLARE_UNNAMED_PROPERTY(GCVSpline, "comment");, it appears in XML as:

<GCVSpline>
 ...
</GCVSpline>

(the name attribute is ignored if it exists).

Now, if I have a class with the following two properties:

OpenSim_DECLARE_PROPERTY(myfunc, GCVSpline, "comment");
OpenSim_DECLARE_UNNAMED_PROPERTY(GCVSpline, "comment");

the XML fragment <GCVSpline name="myfunc"> </GCVSpline> is ambiguous but gets interpreted as the unnamed property.

I think the fix is simple: we remove the ability for unnamed properties to have a name attribute. Instead of ignoring the name attribute, we must make sure it does not exist.

@sherm1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions