Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cases with single unit-magnitude in template #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

william-vw
Copy link

When having a single unitMagnitude as in

<Rule path="/data[at0001]/events[at0002]/data[at0003]/items[at0004]">
    <constraint xsi:type="tem:quantityConstraint">
        <excludedUnits>[in_i]</excludedUnits>
        <unitMagnitude>
            <unit>cm</unit>
            <maxMagnitude>1000.0</maxMagnitude>
            <minMagnitude>0.0</minMagnitude>
            <includesMaximum>true</includesMaximum>
            <includesMinimum>true</includesMinimum>
        </unitMagnitude>
    </constraint>
</Rule>

The code would add the unit-magnitude in the appropriate if-block but also at the end of the method, meaning the same unit-magnitude is added twice.

This fix simply returns in the if-block to avoid this behavior.

@william-vw william-vw changed the title initial commit Fix cases with single unit-magnitude in template Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant