Skip to Content
avatar image
Former Member

Node repitition with default values


There is a node with cardinality 0 to unbounded (corresponding to 7 days in a week) in my source structure. This node has some subfields fields in it.

The source node can occur from 0 to a maximum of 7 times.

This source node is to be mapped to a target node which should be created as many times as the source node occurs and the fields in target node are directly mapped with fields in the source node with some default values(mapWithDefault).

The problem here is if the source node doesn't occur at all in the source structure, the target node should occur exactly 5 times (corresponding to Monday-to-Friday) with some default values for the fields in it. The nodes for Saturday and Sunday shouldn't occur and there are no default values sent for the fields in it.

Need inputs on how to achieve this.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 14, 2010 at 11:13 AM

    use "duplicate subtree" for target node 5 times.

    Assign source - exists - not - createIf each time.

    The default values for the subnodes have to be assigned also 5 times each.

    Add comment
    10|10000 characters needed characters exceeded