8 Replies Latest reply on Jan 30, 2012 6:42 PM by Angusdog

    XML Import - Tables and cells tagged but not working

    Angusdog Level 1

      Hi,

       

      I'm working on an automated document creation project, whereby the user runs a script to import XML from a database.

       

      I've tagged the tables and cells with table and cell styles used in my InDesign document, but InDesign isn't applying them. I can see the attributes in the structure pane but the tables and cells don't have the styles applied.

       

      Any ideas?

       

      TIA,

      Simon.

        • 1. Re: XML Import - Tables and cells tagged but not working
          John Hawkinson Level 5

          CALS tables or InDesign tables?

          Please post a screenshot of the structure pane and a small piece of the XML.

          • 2. Re: XML Import - Tables and cells tagged but not working
            Angusdog Level 1

            Hi John,

             

            Thanks, can do:

            XML:

            xml.gif

             

            Structure:

            structure.gif

             

            While it looks okay, the tables and cells don't have the styles applied in InDesign. I can manually apply them in ID but they need to be automated.

             

            This is my first foray into automating InDesign, importing the XML, formatting it and exporting to PDF and this is the last real hurdle for me.

             

            TIA and have a great Christmas!

             

            Simon.

            • 3. Re: XML Import - Tables and cells tagged but not working
              John Hawkinson Level 5

              Could you please use the Advanced Editor and select >> and choose Syntax Highlighting > XML and paste in your actual XML? That way I can experiemtn with your problem and try to replicate it without transcribing your XML from a screenshot. Thanks!

              • 4. Re: XML Import - Tables and cells tagged but not working
                John Hawkinson Level 5

                Also, could it be that your table is 4x2 but you do not have 8 cells, you only have 6?

                • 5. Re: XML Import - Tables and cells tagged but not working
                  Angusdog Level 1
                  <?xml version='1.0' encoding='UTF-8'?>
                  <!-- This document was created with Syntext Serna Free. --><Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <head>
                      <op_date>Thursday, 6 October 2011</op_date>
                      <op_time_from>2 pm</op_time_from>
                      <op_time_to>6 pm</op_time_to>
                      <op_sections>Section{p}</op_sections>
                      <op_sections>Section{p}</op_sections>
                      <op_sections>Section{p}</op_sections>
                      <version>
                        <op_version>Final</op_version>
                        <op_number>230</op_number>
                      </version>
                    </head>
                    <body>
                    <op_section>
                      <op_sectionhead>Section Head{p}</op_sectionhead>
                      <op_sectionsubhead>Subhead</op_sectionsubhead>
                    
                      <Article>
                        <Table xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid5:tablestyle="OP_Bills" aid:table="table" aid:trows="2" aid:tcols="4">
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="22.177165354330725">
                            <ArticleNumber>1</ArticleNumber>
                          </Cell>
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="292.5354330707756">
                            <ArticleTitle>Title</ArticleTitle>
                          </Cell>
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="43.65354330708669">
                            <ArticleReference>331-2</ArticleReference>
                          </Cell>
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="94.17716535424017">
                            <ArticleSpeeches>Speeches</ArticleSpeeches>
                          </Cell>
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="22.177165354330725"/>
                          <Cell aid5:cellstyle="OP_Bills_Cells" aid:table="cell" aid:crows="1" aid:ccols="3">
                            <ArticleMinister>Minister</ArticleMinister>
                            <ArticleStage>Stage{p}</ArticleStage>
                            <ArticleDescription>Description</ArticleDescription>
                          </Cell>
                        </Table>
                      </Article>
                                      </op_section>
                    </body>
                    <op_date2>Date1</op_date2>
                  </Root>
                  
                  
                  • 6. Re: XML Import - Tables and cells tagged but not working
                    Angusdog Level 1

                    Hi John,

                     

                    Thanks for that - XML above. The number of cells should be okay as the 2nd one on the bottom row spans three cells, but I defer to your greater knowledge

                     

                    Simon.

                    • 7. Re: XML Import - Tables and cells tagged but not working
                      John Hawkinson Level 5

                      The number of cells should be okay as the 2nd one on the bottom row spans three cells, but I defer to your greater knowledge

                      Not a wise idea, that deferral. I defer to my inability to count!

                      • 8. Re: XML Import - Tables and cells tagged but not working
                        Angusdog Level 1

                        Worked it out. I tagged the tables in my XML with the same tag name as my InDesign table style, then mapped the xml tag to my InDesign style in my javascript (which imports the XML).