XML: no xlateInVals element if field not present

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf XML: no xlateInVals element if field not present

  • Creator
    Topic
  • #55320
    Robert Kersemakers
    Participant

      Hi all,

      Just ran into this ‘thing’ on CL6.0.2. I have an Xlate from XML to csv. I am trying something like this

      Code:

      COPY  msg.person.field1  -> @variable
           msg.person.field2
           msg.person.field3

      Assume that msg.person.field1 has value ‘AB’, msg.person.field2 is not present (no node) and msg.person.field3 has value ‘XY’. If I then echo the $xlateInVals inside the COPY, I will see this:

      Code:

      {AB XY}


      Making me think that msg.person.field2 has the value ‘XY’.

      In other words: if an XML field is not present, then it is not included in the $xlateInVals, where I would expect a {}.

      Is this still the case in CL6.1? And is this considered a bug or a feature?

      My quick and dirty solution is to put the field that may not be present (most of them are mandatory) at the end. In this example:

      Code:

      COPY  msg.person.field1  -> @variable
           msg.person.field3
           msg.person.field2

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • The forum ‘Cloverleaf’ is closed to new topics and replies.