4 Replies Latest reply on Mar 25, 2014 9:20 PM by squidz

    Automated XML - Placeholder Structure Question

    squidz Level 1

      I'm testing XML import for a series of publications that need use automated layouts...having never attemped this. But I am confounded regarding the placeholder structure and how it should mirror the XML structure and am banging my head against a wall.

       

      The basics of my pub are: I have profiles for every school in a district. Profiles are grouped by type of school (elem, middle, high). So my test XML example is structured like this:

       

      <elementarySchools>

      <schoolData>

           <name>

           <address>

           <city>

           <state>

           etcetera...the rest of the profile is demographics, testing scores and other stuff.

      </schoolData>

      </elementarySchools>

       

      Each school has about 43 fields.

       

      I setup a document (not a tempate) with the 43 frames and taggge them to correspond to those in the XML

       

      Each time I attempt the import to auto-populate, the XML comes in but no data displays in the frames.

       

      QUESTION 1: Do the 43 frames need to be within a parent frame tagged as schoolData? If I drag a "schoolData" node in, it contains all of the proper data. But the objective is to auto-populate frames so they can be moved and styled as needed.

       

      QUESTION: 2: If I ultimately need data to be displayed in a table-like layout, should I be trying to build tagge table layout?

       

      I've read some tutorials on Adobe and I've watched a couple of Lynda vids, but I seems to be missing something important here. Any pointing in the right direction is appreciated.

        • 1. Re: Automated XML - Placeholder Structure Question
          MW Design Level 4

          I cannot image needing a layout for flowing XML (or any text source file as that is what XML is) into 43 individual frames. nevertheless, it isn't going to happen easily.

           

          You could probably tag some sample text that is in 43 linked text frames. Maybe. Never tried it.

           

          As for table data, you have a few options. It may be a wash as regards the labor involved. One option is to create the tables in the XML file. Another is to format the XML for the areas where tables are desired where the elements are separated by tabs, one row of XML = one row in the table. Then go through and highlight the "tabular" rows and use the text to table command.

           

          In general, I would recommend sketching out your layout to determine what it is you want the publication to look like. Then make it like the picture (so to speak). Use sample data to create paragraph styles. Learn how to use mapping the tags to styles. Likely you don't need 43 frames.

           

          Mike

          • 2. Re: Automated XML - Placeholder Structure Question
            squidz Level 1

            Hey Mike -

             

            The individual text frames are not linked.

             

            They are specific data points for this test. At the moment, I'm simply trying to determine how to automate the import and replication of school profiles that follow a specific pattern and figure out the best approach -- frames or tables. Each profile is associated with the XML tag <schoolData>. Each pair of <schoolData> tags contains 43 data specific data points regarding one school.

             

            What I do know, is that somehow, all of the data points need to auto-populate in a way that I can then format or pre-format at least the basics.

             

            I can import the XML into a blank document with no frames and then drop the my root XML node in, load the cursor wtih the data beyond the first frame and the shift + click the next page and the rest of the data will populate and create the rest of the pages. BUT, it's raw tagged text rather than frames or tables. The data import works. But I need it to map to either frames I can manipulate or tables.

             

            I am just not yet clear on the process and I have not been able to find any detailed tutorial for a more stylish layout. If it were a plane jane catalog it would be fine as is, but our layout is not just a single flow of text on a page with returns and line breaks. I don't think I can use styles to arrange the raw tagged text chunks...though I could be wrong.

            • 3. Re: Automated XML - Placeholder Structure Question
              squidz Level 1

              Circling back on this in hopes someone can help get my ship pointed in a decent direction.

               

              Reading up on tables via XML, as Mike mentioned, not the the greatest method and required building every table in the XML file. That's not really any more efficient for me.

               

              However, since my "table" layout isn't that complex, I could create it using text frames that look like tables when styled correctly. This bring me back to my original issue: How do I get the XML to auto-populate tagged data frames and clone?

               

              As sample layout would be something like this per page. Each "data" element would be a tagged frame, as well as School Name/address/phone/type:

               

              --------------------beginning of school profile <schoolData> xml tag-----------------------

              School name

              school address • phone • type

               

              Heading                                    Heading                  Heading

              ----------------------                      ---------                    ---------

              title | data                                   data                         data

              title | data   

              title | data   

              title | data   

               

               

              Heading                                 Heading

              -----------------------                  ------------------------

              title | data                                title | data

              title | data                                title | data

              title | data                                title | data

              title | data                                title | data

               

               

              ------------------ end of school  profile </schoolData> xml tag--------------------------------

              --------------------beginning of school profile <schoolData> xml tag-----------------------

              School name

              school address • phone • type

               

              Heading                                    Heading                  Heading

              ----------------------                      ---------                    ---------

              title | data                                   data                         data

              title | data   

              title | data   

              title | data   

               

               

              Heading                                 Heading

              -----------------------                  ------------------------

              title | data                                title | data

              title | data                                title | data

              title | data                                title | data

              title | data                                title | data

               

               

              ------------------ end of school  profile </schoolData> xml tag--------------------------------

              >> Repeat through all profiles

               

               

              I can create my layout using frames. All headings and titles can be built into a master page or template. I could set up individual frames for each data point. But I cannot for the life of me get the XML data to auto populate those tagged frames. It still seems to have something to do with the container nodes...that more than one text frame can be nested in another or tables have to be created in the XML...both of which kill the efficiency of using XML.

              • 4. Re: Automated XML - Placeholder Structure Question
                squidz Level 1

                Ok, just in case some other poor sod stumbles across this looking for XML help...I'll wrap this thinking out load exercise up with something that may be of value.

                 

                I finally was able to get the XML structured so that it would populate a blocked out layout. However, XML data merging has some critical limitations for my purposes:

                • cannot populate tables without extreme editing of the XML source
                • a layout that has multiple chunks of data that needs to be grouped in a table-like structure (even if not really a table) requires adding additional XML container elements to the XML source
                • the order by which tags must be added to the layout elements must follow the XML structure exactly or things break

                 

                These three items sunk the idea for this particular publication to be XML driven. There would simply be too much massaging of the XML that began as Excel...defeating the goal of efficiency.

                 

                Instead, I found a vid on tv.adobe.com that is a straightforward guide to accomplish my goal for this publication using the Excel files saves as CSV with virtually no data massaging. I only had to save formula generated data as values only and chose to delete any columns that would not be used in the layout. I was able to take my old layout, select the data source (CSV) in the Data Merge window, replace sample data with placeholders from the Data Merge window and pull the trigger. It didn't matter if the data was in a table or a frame. Seriously easier and not high maintenance like the XML.

                 

                Anyone looking to automate a pub with a repeated pattern, this one was very helpful in getting convincing me the less technical data merge was more suited to my current need. XML is intriguing but not the path this time.

                 

                http://tv.adobe.com/watch/instant-indesign/automating-a-catalog-with-data-merge/