Hello Patrick,

On 30.04.2014, at 15:19, Patrick Ohly <[email protected]> wrote:

> Live and learn. Or use the source, Luke ;-)

:-)

> The logic for choosing a position must now also (or instead?!) check
> whether the LABEL position is unused when adding a new ADR. In other
> words, when parsing an ADR, look at LABEL to determine the position. I
> thought I could achieve that with:
> 
> 
>        <property name="X-ABLabel" suppressempty="yes" groupfield="GROUP_TAG" 
> rule="HAVE-ABLABEL-PROPERTY">
>          <value field="LABEL" repeat="array" increment="1" minshow="0"/> <!-- 
> don't need these on "value" -->
>          <position field="LABEL" repeat="array" increment="1" minshow="1"/>
>        </property>
> 
>        <property name="ADR" values="7" groupfield="GROUP_TAG">
>          <value index="0" field="ADR_POBOX"/>
>          <value index="1" field="ADR_ADDTL"/>
>          <value index="2" field="ADR_STREET"/>
>          <value index="3" field="ADR_CITY"/>
>          <value index="4" field="ADR_REG"/>
>          <value index="5" field="ADR_ZIP"/>
>          <value index="6" field="ADR_COUNTRY"/>
>          <position field="LABELADDR_POBOX" repeat="array" increment="1" 
> minshow="1"/>
>          <parameter name="TYPE" default="yes" positional="no" show="yes">
>            <value field="ADR_STREET_FLAGS" conversion="multimix" combine=",">
>              <enum name="HOME"     value="B0"/>
>              <enum name="WORK"     value="B1"/>
>              <enum mode="ignore"   value="B2"/> <!-- OTHER -->
> 
>              <!-- enum mode="prefix" name="X-CustomLabel-" value="1.L"/ -->
>              <!-- enum mode="prefix" name="X-Synthesis-Ref" value="2.L"/ -->
>            </value>
>          </parameter>
>          <parameter name="X-ABLabel" rule="HAVE-ABLABEL-PARAMETER">
>            <value field="LABEL"/>
>          </parameter>
>        </property>

The problem with this (and most probably the cause of the loop) is that setting 
<position> within <property> to "LABEL" did cause the first value (ADR_POBOX) 
to be stored in LABEL, the second (ADR_ADDTL) in the field that comes after 
LABEL, etc., which is certainly not what you wanted.

<position> can be used to direct the entire block of values for example to a 
second instance of that block with identical layout (e.g. a set of fields named 
"ADR2_xxx"). This was useful in early SyncML implementations, which had a fixed 
layout, like 3 TEL numbers, 2 Addresses, 2 Emails. With array fields, I can't 
imagine a case where the field attribute in <position> would not point to the 
first value field - ADR_POBOX in your case.

> [...] I suspect that this is because of using
> LABEL twice, once indirectly via the group field and once via the
> position field.

That should not matter, especially because one of those two variants is always 
disabled.

What you have here is probably the most elaborate profile ever specified for 
libsynthesis :-) , but I see no reason why it should not work once the 
<position> is correct.

Best Regards,

Lukas

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to