Skip navigation
menah
Currently Being Moderated

How do I check if the associated PageItem is there/exists from a XMLElement ?

Aug 17, 2012 1:18 PM

Tags: #validate #builder #extension #pageitem #exists #xmlelement

Hi,

 

I have the following structure:

 

  • Extension Builder 1.5;
  • InDesign 5.0;
  • Image (Rectangule Frame);
  • XML tag associated with the Image.

 

The following scenario:

 

  • I do have an application that checks if this strucuture is available and intact, that is, the user has not deleted the tag (XMLElement) and/or the Rectangule Frame(PageItem);
  • I do not want loop through allPageItems (the page should have many of them - more than 1000) and get the XMLElement;
  • So, I loop over the XMLElements and get the associated PageItem through xmlElement.xmlContent property;
  • The document images properties (image, epss, etc) never are populated (document.epss.length = 0);
  • I can validate if the tag was deleted or untaged easy.

 

The problem:

 

  • User deletes the Image/Rectangule Frame (PageItem) and keep the xml tag (untag the XMLElement);
  • The isValid property (xmlElement.isValid = true) is true;
  • The associated PageItem becomes a Text and is valid as well;

 

The question:

 

  • How do I check if the associated PageItem is there/exists from a XMLElement ?

 

Regards

 

Marcos

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points