Copy link to clipboard
Copied
Hi all,
In my attempts to import an XML document I have begun encoding tables by means of namespace attributes. When I import the XML, I get the following error message: "<TEVLSTAT> is an invalid table element or appears in the wrong order."
I am at a loss to explain this. Does anyone have any helpful ideas?
Here is the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<HINGSTAR xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/">
<RUBRIK1>Easy Lover</RUBRIK1>
<REGUPPG>Född 1992, svartbrun, reg.nr 92-1015</REGUPPG>
<UPPF>Uppfödare: AB Superbus, Lund</UPPF>
<HERSTAMNING aid:table="table" aid:trows="8" aid:tcols="3">
<CELL aid:table="cell" aid:crows="4" aid:ccols="1" aid:ccolwidth="62">
<NAMN>Mack Lobell</NAMN>
<REKORD>*1.09,7 a</REKORD>
<PRISSUM>22.408.640</PRISSUM>
<LIVSRAD>94 71-10-6</LIVSRAD>
</CELL>
<CELL aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="60">
<NAMN>Mystic Park</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Noble Gesture</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Mystic Sign</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="60">
<NAMN>Matina Hanover</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Speedy Count</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Matora Hanover</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="4" aid:ccols="1" aid:ccolwidth="62">
<NAMN>Delmonica Hanover</NAMN>
<REKORD>1.12,7 a</REKORD>
<PRISSUM>4.621.350</PRISSUM>
<LIVSRAD>124 52-27-14</LIVSRAD>
</CELL>
<CELL aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="60">
<NAMN>Speedy Count</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Speedster</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Countess Song</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="60">
<NAMN>Delicious</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Kimberly Kid</NAMN>
</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="79">
<NAMN>Lively Lady</NAMN>
</CELL>
</HERSTAMNING>
<TSRUBRIK><TSRUBRIK1>Easy Lover</TSRUBRIK1> <TSRUBRIK2>TÄVLINGSSTATISTIK</TSRUBRIK2> <TSRUBRIK3>uppgifter per 2009-10-22</TSRUBRIK3></TSRUBRIK>
<TEVLSTAT aid:table="table" aid:tcols="9">
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="26">Ã…lder</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Antal starter</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Segrar placeringar</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Seger %</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Plac %</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Prissumma</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Prissumma per start</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Volt-rekord</CELL>
<CELL aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="49">Auto-rekord</CELL>
<CELL aid:table="cell">3 år</CELL>
<CELL aid:table="cell">19</CELL>
<CELL aid:table="cell">10-1-0</CELL>
<CELL aid:table="cell">53</CELL>
<CELL aid:table="cell">58</CELL>
<CELL aid:table="cell">545.000</CELL>
<CELL aid:table="cell">28.684</CELL>
<CELL aid:table="cell">*1.19,6</CELL>
<CELL aid:table="cell">1.13,8</CELL>
<CELL aid:table="cell">4 år</CELL>
<CELL aid:table="cell">14</CELL>
<CELL aid:table="cell">3-1-3</CELL>
<CELL aid:table="cell">21</CELL>
<CELL aid:table="cell">50</CELL>
<CELL aid:table="cell">874.550</CELL>
<CELL aid:table="cell">62.468</CELL>
<CELL aid:table="cell"></CELL>
<CELL aid:table="cell">1.13,2</CELL>
<CELL aid:table="cell">5 år</CELL>
<CELL aid:table="cell">16</CELL>
<CELL aid:table="cell">0-3-5</CELL>
<CELL aid:table="cell">0</CELL>
<CELL aid:table="cell">50</CELL>
<CELL aid:table="cell">131.850</CELL>
<CELL aid:table="cell">8.241</CELL>
<CELL aid:table="cell">1.15,1</CELL>
<CELL aid:table="cell">1.14,0</CELL>
<CELL aid:table="cell">6 år</CELL>
<CELL aid:table="cell">5</CELL>
<CELL aid:table="cell">1-0-0</CELL>
<CELL aid:table="cell">20</CELL>
<CELL aid:table="cell">20</CELL>
<CELL aid:table="cell">31.000</CELL>
<CELL aid:table="cell">6.200</CELL>
<CELL aid:table="cell">*1.15,7</CELL>
<CELL aid:table="cell">1.15,2</CELL>
<CELL aid:table="cell">7 år</CELL>
<CELL aid:table="cell">14</CELL>
<CELL aid:table="cell">1-0-1</CELL>
<CELL aid:table="cell">7</CELL>
<CELL aid:table="cell">14</CELL>
<CELL aid:table="cell">319.104</CELL>
<CELL aid:table="cell">22.793</CELL>
<CELL aid:table="cell">1.15,9</CELL>
<CELL aid:table="cell">1.14,6</CELL>
<CELL aid:table="cell">8 år</CELL>
<CELL aid:table="cell">8</CELL>
<CELL aid:table="cell">0-0-0</CELL>
<CELL aid:table="cell">0</CELL>
<CELL aid:table="cell">0</CELL>
<CELL aid:table="cell">7.560</CELL>
<CELL aid:table="cell">945</CELL>
<CELL aid:table="cell">1.18,7</CELL>
<CELL aid:table="cell">1.16,7</CELL>
<CELL aid:table="cell">Totalt</CELL>
<CELL aid:table="cell">76</CELL>
<CELL aid:table="cell">15-5-9</CELL>
<CELL aid:table="cell">20</CELL>
<CELL aid:table="cell">38</CELL>
<CELL aid:table="cell">1.909.064</CELL>
<CELL aid:table="cell">25.119</CELL>
<CELL aid:table="cell">1.15,1</CELL>
<CELL aid:table="cell">1.13,2</CELL>
</TEVLSTAT>
<!-- etc... --></HINGSTAR>
Yours,
MÃ¥ns
What happens if you include aid:tcols="8" in the TEVLSTAT tag?
Bob
Copy link to clipboard
Copied
What happens if you include aid:tcols="8" in the TEVLSTAT tag?
Bob
Copy link to clipboard
Copied
Bob,
Thanks for the help! I assume you mean aid:trows="8". And that does indeed make it work! However, I'd like to avoid adding this if I can, since the number of rows will vary and I don't trust my client's ability to generate XML with variable attributes.
Can I get away with that somehow?
Yours,
MÃ¥ns
Copy link to clipboard
Copied
Sorry, not that I know of.
You could always pre-process the XML to make sure the aids are correct. Load the file into an XML object, do the count yourself, update the aids, the overwrite the file and import it into InDesign.
I wrote my own simple XML parser in ES to do pre-processing with html snippets so I could handle cases like <br> <hr> and <p> (without a </p>) and other such minor XML errors. Then it writes it out in well formed XML. I wrote the parser before ES supported XML, but it still comes in pretty handy for pre-processing xml prior to import into ID.
Bob
Copy link to clipboard
Copied
Bob,
Thanks again. My client'll have to live with that then. With any luck, it means more work for me. ![]()
//MÃ¥ns
Copy link to clipboard
Copied
Have you considered avoiding tables altogether? InDesign will happily "clone" repeating elements, no matter how many of them there are, no matter if there are varying numbers of them in the XML file.
If you separated cell contents using tab characters, and table rows using paragraph returns, you would end up with a two-dimensional array of imported values, whose size depends on how many elements there are in the imported XML file. If you carefully used paragraph rules (for horizontal borders) and/or anchored objects (for vertical borders) you could end up with something that looks like a table, even though it really isn't.
Jeremy
Copy link to clipboard
Copied
Jeremy,
Thanks for the suggestion! I will keep that solution in mind for the future. For the current project, however, that will probably not be necessary. I have suggested the use of aid:trows to the client, and so far they haven't protested.
Yours,
MÃ¥ns
Copy link to clipboard
Copied
Hallo,
I have same problem but all parameters seems ok...
<Table> is an invalid table element or appears in the wrong order.
<variant>
<Table xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid5:tablestyle="Art.-Table" aid:table="table" aid:trows="64" aid:tcols="7">
<cell aid5:cellstyle="Art.-Cell" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="58">
I am using Indesign CC 2014
Copy link to clipboard
Copied
OK, i have the answer. I had more than 100 rows from database.
NOw question is, how to tell table that there are indefinate number of rows??
in my final product, i am going to have almost 7000 rows and i need to create a table which overflows and gouls to new page automatically when i import XML.
Second thing, when i try to import single table with so many cells in it.... it taking hrs to get imported and construct a table in indesign page.
I broke up the cells in multiple tables and it works efficiently. But problem wit it is.... tabels are not interconnected.... so i delete or add more rows ... it wont reflect in next tables.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more