6 Replies Latest reply on Jul 15, 2013 7:38 PM by thomasdalbert

    XML Data order

    thomasdalbert

      In the FileMaker Server 12 documentation for Custom Web Publishing with XML it say on page 22:

      "If you want the XML data order to match the order in which fields appear on the screen (top-to-bottom, left-to-right order), then select all fields, group them, and then ungroup them. This procedure resets the layout order to match the screen order."

      For some reason, this does not work for me - the field order in the returned XML is the same as it was before.

      Do you know how to have a specific order in the XML file that is being returned?

      Thanks,

      Thomas

        • 1. Re: XML Data order
          Malcolm

          Do you know how to have a specific order in the XML file that is being returned?

           

          This is determined by the TAB order. You can look at the tab order to see if it is doing what you want and modify it by hand.

           

          Malcolm

          • 2. Re: XML Data order
            thomasdalbert

            Changing the tab order on the layout that is used to get the XML data didn't not change the order. I even tried creating a new, blank layout and added the fields with copy/paste into this new layout in the correct order. But the order is stubbornly sticking to the order that was created when the page was first set up with the fields for the XML call. The strange thing is that it's not even the order that the fields were originally created in the database.

             

            The only way I can get them into the right order is if I create a blank layout and then copy/paste the fields one by one in the correct order into the layout. Doable but a bit cumbersome if you have to do it with many fields.

             

            I'm a bit surprised though that I can't change the order with the method that is described in the documentation.

             

            Thanks,

            Thomas

            • 3. Re: XML Data order
              Malcolm

              The only way I can get them into the right order is if I create a blank layout and then copy/paste the fields one by one in the correct order into the layout. Doable but a bit cumbersome if you have to do it with many fields.

               

              Having done that, doesn't the order of the fields and the tab order correspond?

               

              malcolm

              • 4. Re: XML Data order
                thomasdalbert

                Yes of course - when you add new fields to a layout the default tab order is in the order that they are placed.

                 

                But that doesn't mean that the tab order specifies the order in which the XML data is returned. Otherwise I could set the tab order on the layout that doesn't return the data as the fields appear. The documentation says I should be able to group the fields and then ungroup them but that doesn't change anything.

                 

                Thanks,

                Thomas

                • 5. Re: XML Data order
                  mbraendle

                  I'm wondering why the order should be important.

                  Anyway, if you parse the XML for some purpose with any method (AJAX library, XSLT, ...), you would address the fields by using the @name attribute.

                  • 6. Re: XML Data order
                    thomasdalbert

                    You are absolutely correct: to parse the XML file, I don't need the specific sequence but for debugging and readablility it would be nice to specify the sequence of the fields. I thought because the documentation was specifically stating how to achieve this that I might have overlooked something since it wouldn't work for me. But I can live without this option if it's not working.

                     

                    Thank you for your pointers!