Skip navigation
Currently Being Moderated

XML: print parents of an element from root

Aug 18, 2012 5:54 AM

Tags: #javascript #indesign #xml #xpath

Hi Everybody,

 

Is there any way in Indesign Javascript to literally print the parents or ancestors (xpath) of an element from the root element of an xml file. The below screenshot is the output from Perl script. And the code of Perl script is:

 

"my @elt = $twig->get_xpath('//index/index-list');

 

for(my $i=0; $i<scalar(@elt); $i++){

        print $elt[$i]->xpath, "\n";

}"

 

output.png

 

Can we get the same kind of output using Indesign Javascript?

 

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