translate XML file in Cloverleaf 5.7

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf translate XML file in Cloverleaf 5.7

  • Creator
    Topic
  • #52459
    Ran Yan
    Participant

      Hi, in cloverleaf 5.7, can we use translation to translate a XML file to a HL7 file? If so, do you know the steps to create xsd and apply the xsd in XLT? I tried to do so, but failed. THanks

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

          Ran,

          It is important you have a properly formed schema (xsd).

          Place the xsd file on your PC. From the GUI use the XML Package Manager.

          You will see two Panels: Client File Viewer and Server Package Viewer.

          Right mouse button click on the xml folder in the ‘Server Package Viewer’ panel and select ‘New Package/folder’. Name your new folder.

          Now in the ‘Client File Viewer’ panel right mouse button click on the xsd file you want and ‘Copy’. Now go over to your new folder in the ‘Server Package Viewer’ panel, right mouse button click and ‘Paste’.

          Now this xsd needs to be compiled so select the xsd in the ‘Server Package Viewer’ panel, right mouse button click and select ‘Compile’.

          If this successfully compiles, you can now reference this in an Xlate.

          The Cloverleaf toolkit does not build xsd files. Either insist the vendor provide you with an elecftronic xsd (not a PDF display of the schema but an actual xsd) or purchase 3rd party tool that allows building xsd.

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

        • #74278
          Mike Campbell
          Participant

            Ran,

              Just watch when you start the actual mapping in the xlate.  The XML layout has several fields with each output including one like : ##anyAttribute.

            From experience, you get strange results if you try to map the input to

            the ##anyAttribute.

          • #74279
            Ran Yan
            Participant

              Cool. Thank you!

              I just successfully compiled the xsd file in Cloverleaf. Now I am editing the xsd to match the XML file from third party vendor. Unfortunately, they do not provide xsd form to us, only XML file. Would you please help me check whether my xsd file is a match? Thanks

              xsd file

              <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&#8221;

              targetNamespace=”http://www.w3schools.com&#8221;

              xmlns=”http://www.w3schools.com&#8221;

              elementFormDefault=”qualified”>

               

                 

                   

                   

                   

                   

               

               

               

               

               

               

                 

               

              XML

               –

               XXXX MEDICAL CENTER

               05422

               XXXXX VISTAD

               12/19/1949

               CLINIC

               DEXA BONE DENSITY AXIAL-77080

               TAL-599142

               03/02/2011 11:55 AM

               XXXXX

               XXXXXXXXXXXXX

               

              actually, in ROWDATA segment, it includes all files, each in the ROW segment

            • #74280
              Jim Kosloskey
              Participant

                Ran,

                I am not in the xsd building business for other’s (vendor) messages. My policy is the vendor needs to provide me with a schema and one that not only is well-formed but also actually matches their data. After all this is their data and they should be able to provide you with a layout (schema). If this were an FRL you would expect a record layout – XML should be no different – and there is actually a standard for the layout.

                Others on the forum may be able to assist you.

                I believe there is software on the market that will attempt to buid an xsd from an xml file.

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

              • #74281
                Mike Campbell
                Participant

                  I saw this freeware app:

                  http://www.dotkam.com/2008/05/28/generate-xsd-from-xml/

                  I haven’t used this one, but id sounds fairly easy and straight forward.

                • #74282
                  Ran Yan
                  Participant

                    Mike Campbell wrote:

                    I saw this freeware app:

                    http://www.dotkam.com/2008/05/28/generate-xsd-from-xml/

                    I haven’t used this one, but id sounds fairly easy and straight forward.

                    I tried to use this program, however, when I run it, it gives me this error:

                    fatal: exception “com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException” thrown: Invalid byte 1 of 1-byte UTF-8 sequence.

                    do you have any idea what’s going on?

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