9 Replies Latest reply on Nov 20, 2012 10:54 PM by Beat

    DesignReport with invalid XML characters

    Beat

      Hello everybody

       

      DDR is really a great tool, but somtimes I get problems with its output. There are XML files written with invalid characters (eg. Unicode: 0x1c). Like this, it is not possible to extract information from these files with for example EditX. I didn't check if BaseElements can deal with such errors.

       

      What is the reason for invalid XML characters? They don't seam to come from field contents but appear between the tags (not rendered).

       

      Is there any easy way to clean up the files?

       

      Thanks a lot for any suggestions.

       

      Beat

        • 1. Re: DesignReport with invalid XML characters
          psijmons

          I'm not sure if I remember this correctly, but when you open the DDR with something like Textmate, find the error code that came up and you should be able to identify where the problem is.

          • 2. Re: DesignReport with invalid XML characters
            nickorr

            Beat,

             

            The issues with invalid XML appeared in v11 and are fixed in v12.  You can remove them manually, or you can use our free BaseElements plugin http://www.goya.com.au/baseelements/plugin which has a function to strip them out of the xml files.  We use that inside BaseElements itself, so we can import the files without issue.

             

            Cheers,

            Nick

            • 3. Re: DesignReport with invalid XML characters
              Beat

              Thank you both for your answers.

               

              I use TextWrangler, but I don't know how to find characters that don't show in the text (Unicode 0x1c). And I tried the baselemt plugin function. It reurns 1 (MacOs Error Code -> bus error (?) or 'ok' ?). But nothing happens, nothing has changed within the file. Am I missing something?

               

              Beat

              • 4. Re: DesignReport with invalid XML characters
                nickorr

                Beat,

                 

                The plugin uses the OS paths, not FileMaker paths.  To get an idea of the right path, use the Select File function.  You can even do this :

                 

                BE_StripInvalidUTF16CharactersFromXMLFile ( BE_SelectFile ( "" ) )

                 

                Which asks you for the file and then cleans it up.

                 

                Cheers,

                Nick

                • 5. Re: DesignReport with invalid XML characters
                  Beat

                  Nick,

                  sorry, I edited my answer after I found the BE_SelectFile() Function. That was a bit stupid, I wan't do it again:)

                   

                  In the end, it's exactly what I did:

                   

                  SetVariable[$File ; Value: BE_StripInvalidUTF16CharactersFromXMLFile ( BE_SelectFile ( "" ) )]

                   

                  After that, $File has the value 1, the XML File is unchanged: same modification date as before, and EditX still reports the same invalid XML character error. Does 1 mean ok or is it a MacOs Error Code (bus error)?

                   

                  I have used EditX to transform many of the DesignReport Files, even much larger ones. So I think there must be really something wrong with this file and not with EditX.

                   

                  Beat

                  • 6. Re: DesignReport with invalid XML characters
                    nickorr

                    Beat,

                     

                    A result of 1 means it worked.  Are you trying this straight from the DDR, without first editing it in another app?  Can you send me a copy of the file off list, I'll see if I can pinpoint the actual issue.

                     

                    Cheers,

                    Nick

                    • 7. Re: DesignReport with invalid XML characters

                      Beat,

                       

                      The problem comes from using special characters as string literals in FM versions < 12.

                      So instead of using "

                      ", where any low ascii character may reside between the quotes, you should use the function Char(x), where x is the decimal representation of the code, in your case 28 for 0x1C.

                       

                      FM12 does indeed generate valid XML, nevertheless the code is shown as "?" and hence lost.

                      I strongly recommend to always use the Char() function instead.

                       

                      Winfried

                      • 8. Re: DesignReport with invalid XML characters
                        nickorr

                        Winfried Huslik wrote:

                         

                        Beat,

                         

                        The problem comes from using special characters Re: DesignReport with invalid XML characters as string literals in FM versions < 12.

                        So instead of using "

                        ", where any low ascii character may reside between the quotes, you should use the function Char(x), where x is the decimal representation of the code, in your case 28 for 0x1C.

                         

                        FM12 does indeed generate valid XML, nevertheless the code is shown as "?" and hence lost.

                        I strongly recommend to always use the Char() function instead.

                         

                        Winfried

                         

                        Winfried,

                         

                        This isn't always the case.  A large number of invalid characters I've seen have been in non calculations.  So things like the data separator character for a layout object.  Those things you can't control, and were causing validation issues in the XML.  In fact I'm yet to see a calculation cause this issue.

                         

                        Cheers,

                        Nick

                        • 9. Re: DesignReport with invalid XML characters
                          Beat

                          Nick,

                           

                          Did you get the private message?

                           

                          Beat