VRL to XML issue with empty xml segments.

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf VRL to XML issue with empty xml segments.

  • Creator
    Topic
  • #49498
    Vincent Tran
    Participant

    I have a VRL file that when translated, generates many empty unwanted xml segments. This doesn’t happen when translating from an HL7 file to xml though.

    small example:

    ABC|123|||

    translates to:

    <1>ABC<2>123<3 /><4 />

    Note the 3rd and 4th fields.

    I can remove it using a post script, but I am wondering if maybe I just configured my VRL incorrectly such that it doesn’t recognize nulls. Attached is a screenshot of my VRL configuration.

    – Vincent

Viewing 5 reply threads
  • Author
    Replies
    • #62234
      Jim Kosloskey
      Participant

      Vincent,

      I am expecting you are doing an Xlate.

      If so, you could check each field for @null and not copy if it is null.

      However, it may be that the XML schema somehow specifies that each element is required and thus will be created even if there is no value.

      In that case, perhaps a change to the XML schema will allow empty tags to disappear.

      Of course, I am speaking from very little experience with XML and Cloverleaf(R).

      Thanks,

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com

    • #62235
      Vincent Tran
      Participant

      Thanks for the reply Jim.

      The XML schema/dtd is fine because I use it for HL7 to XML xlate.

      This is interesting, I echo $xlateInVals and it prints out {}

      If I go:

      set xlateOutVals $xlateInVals

      although the value of $xlateInVals is {}, it still generates the empty xml segment.

      However if I go:

      set xlateOutVals {}

      it doesn’t generate the empty xml segment like it is suppose to.

    • #62236
      Jim Kosloskey
      Participant

      vincent,

      Hmmm,

      Try

      set xlateOutVals [lindex $xlateInVals]

             instead of

      set xlateOutVals $XlateInVals

             and let us know what happens.

      Thanks,

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com

    • #62237
      Vincent Tran
      Participant

      That generates the empty XML segment as well.

    • #62238
      Jim Kosloskey
      Participant

      Vincent,

      I hate to keep putting you through this but – what happens with

      set xlateOutVals

        Thanks,

        Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com

    • #62239
      Vincent Tran
      Participant

      That too generates an empty xml segment.

      However for non empty fields in the VRL, it does not output the XML segment using set xlateOutVals

Viewing 5 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,041
Forums
28
Topics
9,199
Replies
34,021
Topic Tags
266