Inserting anchored frame into XML element. How to?
I have the following problem: In an xml file that I import into InDesign, and subsequently process, I need to do the following: Among other structure elements there is one that represents a table. It looks like this:
content content content last actual content imagepath
The artrow element can, of course be repeated a few times. In the last artcell in every row, there is a path to an image. Now I want to take that path and create an anchored frame with this image placed into it. The anchored frame should be anchored into the the next to last artcell element in every row. What I've been trying is to (I am iterating through the xml file using xml rules) convert the arttable element to table, then read the contents of the last cell in the table, find the last insertion point in the next to last cell and place the image there, after which I set the properties for the resulting frame. It does not work. In fact, if I try to access any property of the cell (next to last one), through scripting, InDesign dives to a horrible death. Then I used the associated xml element property of the table instead. Now I can access the cell contents through associatedXMLElement.xmlElements.item(i), and so on. It is however still impossible to place an image into the element, although InDesign stays alive this time. I have been trying this with an ordinary table in a non-xml based InDesign document, and it works. Any clues as to how to proceed??