Formatting an XML File for Readability

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Formatting an XML File for Readability

  • Creator
    Topic
  • #48606
    Bevan Klassen
    Participant

      I have successfully translated an HL7 file to XML, but the format of the XML file is not displayed in a readable format (i.e. each field is pressed against the next field).  

      I can format the XML file using XMLSpy and the ‘Assign Schema’ option, but I’m thinking Cloverleaf should do this for me.  

      Any help would be appreciated.

      Thanks,

      Bevan.

    Viewing 2 reply threads
    • Author
      Replies
      • #59131
        Jim Kosloskey
        Participant

          Bevan,

          Are you viewing the file via the Tester?

          If so, set your Detail level higher than 0 (zero).

          If not, what are you using to view the data that is not looking good?

          Jim Kosloskey

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #59132
          Bevan Klassen
          Participant

            Jim,

            This is my first XML interface and when I was viewing the XML with a text editor, I was expecting to see the XML tags formatted like they are when I view them in a web browser, but I’m begining to see my miss here.  When I view an XML document, I need a program to interpret the XML and format it for my viewing.  

            Thanks for your response which got me thinking further.

            Bevan.

          • #59133
            Charlie Bursell
            Participant

              Two options here.

              !. Name the output to .xml and bring it up in a web browser.  Make sure the file is new-line delimited.

              2.  I wrote a script named xmlpretty.  It may be in the contrib directory of the latest releases.  If not, here it is.  On Unix, rename to xmlpretty nad make sure it is executable.  Also make sure firts line points to proper path for Tcl

              It was a “quick and dirty” script so it may have problems with some of the more “fancy” things in XML.  So far it has worked for me.

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