Xml and Spaces

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Xml and Spaces

  • Creator
    Topic
  • #53590
    TorfinnK
    Participant

      Hello Clovertechers

      I’m have som problem on Xlating to Xml on 5.7Rev3.

      The input file looks something like this.

      Code:

      ~4510~ ~  ~~


      and I want the Xml to look something like this

      Code:

      4510

       
      or

      It seems that I cant put spaces as a value in the Xml.

      I can circumvent this with replacint spaces with # before the Xlate and from # to spaces after the Xlate, but there must be a better way.

      I have a simulare issue with attribute, seems that I can’t write an empty atributte like this

      Code:

      Value

    Viewing 3 reply threads
    • Author
      Replies
      • #78213
        Robert Kersemakers
        Participant

          Hi Torfinn,

          You should be able to post one or more spaces to an XML-field. I have done this myself within an Xlate; just tested this:

          Code:

          COPY =  -> XMLField


          where ‘= ‘ is the space of course.

          Haven’t had the need to play with attributes myself, so can’t help you there.

          Can you show us the code you are using right now?

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #78214
          TorfinnK
          Participant

            I hate to say this, but I was wrong.

            The story is that I’m upgrading one site from 5.3 to 5.7 and I’ve tested the Xlate in testing tool. When I do that I get the following

            Code:

            [0:TEST] XML Content Model Error: Failed to match required node ‘oes:Segment2.#text’.
            [0:TEST] Non-Deterministic XML Content Model: at least one element could correspond to multiple elements in the content model.

            But the outbound Xml has the correct spaces. I was a bit confused because I opened the Xml in Explorer and Explorer hides these spaces,   is showns as .

            It doesn’t seem to be the Xlate the gives the error but the validation against the Format (xsd /ocm). If I put the outbound Xml through the Xml test in testing tool I get the same Warning and Error

            I also get the same warning and error in the engine:

            Code:

            [msg :RecD:WARN/0:  oedup_xlate:04/03/2013 10:08:15] XML Content Model Error: Failed to match required node ‘oes:Segment3.#text’.
            [msg :RecD:ERR /0:  oedup_xlate:04/03/2013 10:08:15] Non-Deterministic XML Content Model: at least one element could correspond to multiple elements in the content model.

            But if someone has a solution /explanation for this I would be grateful

          • #78215
            Jim Kosloskey
            Participant

              Torfin,

              Have you looked at the file in hex – maybe that is not spaces between the tags – maybe something like binary zeros?

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            • #78216
              Robert Kersemakers
              Participant

                Newer versions of Cloverleaf have a better/stricter check of the resulting XML against the XSD/DTD format, although the error messages are still very cryptic, to say the least.

                You will have to check the outbound XSD/DTD format and especially for elements that are used more than once in the definition. As the error messages says: Cloverleaf/the parser can’t determine which element to take.

                Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

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