Announcement

Collapse
No announcement yet.

Illegal XML character: 0x1f

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Illegal XML character: 0x1f

    All,

    I'm at a loss on how to figure this out. I'm trying to create a channel that will read an HL7 file (file reader) and the write it to another directory, unchanged, filtered on field PV1.8.1. However, I keep getting the attached error when I try to run it. FYI. If I leave the filters off, the files will move through the system without error. As soon as I put the filter on, I start getting this error. Any help, tips or tricks would be greatly appreciated.

    Thanks,

    Dan
    Error.txt (16830 bytes)

  • #2
    Re:Illegal XML character: 0x1f

    Also attached is my channel. Channel.xml (7200 bytes)

    Comment


    • #3
      Re:Illegal XML character: 0x1f

      I know this is one of the things you learn from experience. In the filter, you check if PV1-8 is 29.341. Everything (at least all the values) is a String type. so you'd have to wrap it around double quotes. Try "29.341" in the value column.
      Chris Ro
      Sr. Software Engineer | Mirth Corporation

      Comment


      • #4
        Re:Illegal XML character: 0x1f

        Thanks for the reply. I did some more testing with this and found it was only certain messages that are throwing this error. The filter works ok without the double quotes and messages process successfully. However, certain messages still throw this error. Any ideas on what else I should look at?

        Dan

        Comment


        • #5
          Re:Illegal XML character: 0x1f

          ok, apparently it looks like those messages contain an invalid character '' (hexadecimal value 0x1F). You can write a simple script to remove such characters in the preprocessor to avoid these errors.

          message = message.replace(/\u001f+/g, "");
          Chris Ro
          Sr. Software Engineer | Mirth Corporation

          Comment


          • #6
            Re:Illegal XML character: 0x1f

            Thanks! Worked perfectly!

            Comment


            • #7
              Re:Illegal XML character: 0x1f

              I have a similar problem. Where do you place the script message=message.replace()?

              Comment


              • #8
                Re:Illegal XML character: 0x1f

                I have a similar problem. Where do you place the script message=message.replace()?

                Comment


                • #9
                  Re:Illegal XML character: 0x1f

                  I have a similar problem. Where do you place the script message=message.replace()?

                  Comment


                  • #10
                    Re:Illegal XML character: 0x1f

                    This goes in a transformer script.

                    Comment

                    Working...
                    X