1 Reply Latest reply on Dec 10, 2012 8:23 AM by regina63

    xml borders


      Hello everybody...i am new to xml and indesign...i am using indesign cs5.5....i want to make tables with borders....i am successful in making tables with borders in indesign but when i export them as xml (ofcourse after tagging them) the code of the table shows up but nothing more happens....neither the data written in the cells do follow rules of tables nor the border shows up.....actually i am building a website...kindly help me out please...thanks

        • 1. Re: xml borders


          EDIT: I *just* saw your last line where you state you are building a website. So instead of the answer below, I think you should save your Indesign document as an html project from Indesign to get your HTML tables, created from the indesign tables you've built... not export as XML. What you won't get is the styles, but the structure will at least be HTML tables and not XML tables. When you start a new document you can select "Web" as your intent in the New Document window. Copy your table (and any other elements) in from your previous print-intent document, also import your styles from your previous document. Then export FOR Dreamweaver from the file menu. This will create the appropriate td styles for you to populate in Dreamweaver (or plain text editor) covering all present table structure styles you had created. Unfortunately still empty, but you'll know what you need to style by looking at the list.


          When you export tables with tags, Indesign won't export your assigned style attributes if you've used them to style your tables (cell style, table style, character styles and paragraph styles). And even CS5.5 did not export the necessary namespace aid5 needed for the cellstyle attribute (which does exist) to work, but once you have the xml table structure exported from your Indesign file to XML, you can add certain style attributes or modify tags manually with a text editor, using aid5:cellstyle="" for cells, or deliberately naming your table tags with specific names which you can then map to table styles in the Indesign templates that you build to process this XML. Use any name with plaintext characters and NO spaces, whether creating a cellstyle attribute (which matches a cellstyle in your indesign template) or a table tag name (which will be assigned to map to a table style in your Indesign template).


          In the Indesign file that will receive the final xml, you will need to have a corresponding cell style with the exact same name created in the cell styles palette (in my example "cellStyleL"). The incoming XML's aid5:cellstyle="" attribute will take on the cell style that you've built in the cell styles palette in your document as long as the names are an exact match and you've included the proper namespace in your table tag (see note below). One of the things you can apply to cell styles in Indesign is a border. This may not be the best way if what you want is a border around the entire table because you'd need to create styles for first column, first row, last column and last row to only put borders on the outside of a table one cell at a time, and you'd be applying that attribute to every cell along the table's outer edge. And actually, the corner cells would need 4 additional separate styles.


          So a much easier way to put a border on larger tables is to apply a border to a table style in Indesign. Unlike the cell ATTRIBUTE "cellstyle" which grabs the available cellstyle with the same name AUTOMATICALLY, the table TAG will need to be manually mapped to a table style you've created in Indesign (see note below on mapping).


          Rather than naming your table tag just "Table" for instance, you can call it tableZ, and in Indesign, create and map the tag tableZ to the table style you've created in the table styles palette (of course keeping names the same will make it easier to track even if the mapping isn't automatic), and include a border in your table style when you create it. You can leave all your table tags named "Table", but if you don't want all tables in your document to have the same exact border, use additional names. The table tag can be renamed anytime so long as you always include the necessary attribute aid:table="table" in that opening tag, and close the tag using the same alternative name you started the tag with.


          Here's an example I hope clears this up a bit. Compare it to the XML you've exported and you'll see where you need to edit it manually. Notice there are 2 namespaces used in the opening table tag: aid and aid5. If you don't include both, you will  not be able to utilize cellstyle (which is very useful for formatting columns and rows differently, even if you outline the table with the second method above). Pay special attention that all aid attributes start with "aid:" and that the cellstyle attribute starts with "aid:5".

          <tableZ xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="1" aid:tcols="2">

                      <Cell aid:table="cell" aid:ccolwidth="250" aid:theader="" aid:ccols="1" aid:crows="1" aid5:cellstyle="cellStyleL" aid:pstyle="myParagraphStyle">your cell content in row one column one</Cell>

                      <Cell aid:table="cell" aid:ccolwidth="250" aid:theader="" aid:ccols="1" aid:crows="1" aid5:cellstyle="cellStyleL" aid:pstyle="myParagraphStyle">your cell content in row one column two</Cell>



          The above is a 1 row 2 column table, which is stated in the opening table tag attributes (this row/column count should be present on incoming xml since there is no other way for indesign to tell when a row has ended).


          To map a tag to a style open your tags palette, create a tag with a name you'll use as your attribute name (aid5:cellstyle) or table name (table tag name) in the XML. in the top right menu IN the tags palette, select "map tag to styles" from the menu. In the resulting dialog box, pick the tag you just created from the list on the left, and pick the style you want to map it to on the right pull down menu (again, making the names match will make this part easy). Note that the styles are arranged by type, so all cell styles are together, all table styles are together, all paragraph styles are together, etc. I'm not sure they are necessarily in alphabetical order by style, even though you can arrange TAGS in alphabetical order from the menu.


          Hope this helps. Sorry it's so long after the initial post.