Some ideas:
It maybe a matter of taste, but using snake_case
for tag names seems strange to me. camelCase
or dash-separated
would be better.
Tag names like A_field
and B_field
are not great, especially when you use them to indicate field names. srcName
and dstName
would be better, to clarify that they are about names, and the source and destination.
In the description you wrote that values should be many-to-one, but then in value_mapping
you have a single A_value
and multiple B_values
. Intuitively, I would imagine the mapping goes from A to B, but your sample looks like B to A.
In <A_value name="A_value">
you use the name
attribute to indicate a value. A value
attribute would be more natural.
How about something like this:
<objMapping>
<field>
<srcName>ou</srcName>
<dstName>OrganizationUnit</dstName>
<valuesMapping>
<dstValue value="IT">
<srcValue>Development</srcValue>
<srcValue>QA</srcValue>
<srcValue>Support</srcValue>
</dstValue>
</valuesMapping>
</field>
</objMapping>
I didn't change the overall structure of the tree of nodes. It seems to make sense to me. But you would have to test it and see if it's really ergonomic or not.
Finally, you asked for a many-to-one mapping of the values, so just beware that the mapping will be one-way, non-reversible.
A_field
andA_value
in separate branches? Maybe simple<A_values name="A_field_name"><A_value name="A_value"><B_values name="B_field_name"><B_value>B_value_1</B_value><B_value>B_value_2</B_value></B_values></A_value>
? – ony Dec 27 '12 at 13:22