Xlate: insert comment into XML outbound

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Xlate: insert comment into XML outbound

  • Creator
    Topic
  • #51561
    Jim Kosloskey
    Participant

      All,

      What I would like to do is to insert comments in an outbound XML message via the Xlate.

      Does this require strategically placed entries in the schema which are placeholders for comments, or is there a method within the Xlate (using XML for outbound) which can insert a comment (my thought is there is not), or will I need Tcl after the Xlate to place comments?

      My aim is to make the resultant XML message easier to read for debugging.

      I know I can enter comments free hand wherever by using any XML editor so it does not appear XML provides a placeholder for comments in it’s language set.

      However, being a novice at XML, I am unsure of all of the potentials.

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

    Viewing 1 reply thread
    • Author
      Replies
      • #70772
        Robert Kersemakers
        Participant

          Hi Jim,

          At first I thought you wanted to know if there’s a way to include comments in an XML, but after rereading your question I think you already know this:

          Quote:

          The syntax for writing comments in XML is similar to that of HTML.

          I don’t think it’s possible to just insert comments with an Xlate: Xlates will need a field to place their information. So I agree with you: either include extra fields in the XSD/DTD to insert the comments or insert the comments after the Xlate with tcl.

          If you could insert comments with an Xlate, the problem would be how to indicate where you want this comment to be inside the XML.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #70773
          Jim Kosloskey
          Participant

            Robert,

            You understand what I was asking.

            I was pretty sure that comments would need a placeholder in the schema in order to use the Xlate to populate comments but I felt it was worht aksing in case I was missing something.

            I would be reluctant to modify a vendor’s schema to add comments as then that becomes my schema to maintain and if the schema failed to function it would be difficult to request the vendor to repair the schema.

            At this point I think using Tcl to add comments after the fact is more trouble than it is worth and I would need to design something that was reusable and yet meaningful to the person configuring the use of the proc.

            Given the verbosity of XML it sure would be helpful to be able to have comments when trying to figure out what is where in the message.

            Thanks

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

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