Skip to content

<choose> fails to output fallback values if flushWith is set to an entity. #110

@cboehme

Description

@cboehme

This test case demonstrates the problem:

<test-case name="">
    <input type="text/x-cg+xml">
        <cgxml:cgxml version="1.0">
            <cgxml:records>
                <cgxml:record id="1">
                    <cgxml:literal name="L" value="V" />
                </cgxml:record>
            </cgxml:records>
        </cgxml:cgxml>
    </input>

    <transformation type="text/x-metamorph+xml">
        <mm:metamorph version="1">
            <mm:rules>
                <mm:choose name="chosen" flushWith="entity|record">
                    <mm:data source="entity.data1" />
                    <mm:data source="L" />
                </mm:choose>
            </mm:rules>
        </mm:metamorph>
    </transformation>

    <result type="text/x-cg+xml">
        <cgxml:cgxml version="1.0">
            <cgxml:records>
                <cgxml:record id="1">
                    <cgxml:literal name="chosen" value="V"/>
                </cgxml:record>
            </cgxml:records>
        </cgxml:cgxml>
    </result>
</test-case>

The input record does not contain entity.data1. Hence, <choose> should fall back to the value of L. This only works, though, if flushWith does not contain an entity to flush on.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions