3 Replies Latest reply on Dec 10, 2012 2:28 PM by hkyorenet

    how can i back reference to page items from xml elements?

    hkyorenet

      Hi,

       

      I am trying to add coordinates of the page items to their associated xml elements as xml attributes.

       

      I can easily create xml elements using

       

      myDocument.mapStylesToXMLTags();

       

      Now, i want to iterate through the xml document and find the coordinates of each associated page item and  then add  them to the corresponding xml node as attributes.

       

      That is, i am trying a code (assuming all xml nodes as the children of the root for simplicity) as follows:

       

      for( var i=0; i<myRootXMLElement.xmlElements.length; i++) {

           var myElement=myRootXMLElement.xmlElements.item(i);

           var myElementsPageItem= ****** could not find a proper function/reference from documents ******

           var myBounds=myElementsPageItem.visibleBounds;

           addORupdate( myElement, 'y1', myBounds[0]);

           addORupdate( myElement, 'x1', myBounds[1]);

           addORupdate( myElement, 'y2', myBounds[2]);

           addORupdate( myElement, 'x2', myBounds[3]);

      }

       

      At my sample document all xml elements that is created by mapStylesToXMLTags() are of type story.

      So i need a way to refer to the corresponding page item (or rectangle) of the story so that i can add the coordinate information to xml element as attributes.

       

      Many thanks...