Copy link to clipboard
Copied
Dear All,
How find the following-sibling::, preceding-sibling:: & parent:: element and attributes using evaluateXPathExpression option in indesign.
Please suggest me best way to find xml element and attributes.
Regards,
~Jackkisten
Copy link to clipboard
Copied
Hi
Be aware xpath implementation in ExtendScript is all but exhaustive. Most of those axes won't work.
Due to the one-pass nature of this implementation, the following XPath expressions are specifically
excluded:
No ancestor or preceding-sibling axes, including .., ancestor::, preceding-sibling::.
See xpath limitations in Adobe Scripting guide for more details.
Loic
Copy link to clipboard
Copied
Hi All,
Then how we can use xpath in indesign to find the xml node
Copy link to clipboard
Copied
Well, you can still use evaluateXPathExpression to retrieve xmlElements and once grabbed look for following/preceeding-siblings by using indeces or collection nextItem(), previousItem() special functions.
For parent, you can use…parent property of any xmlElement…
FWIW,
Loic
Copy link to clipboard
Copied
Hi Loic,
Could you possible to give some example and sample code for evaluateXPathExpression, collection.
Thanks in advance!!
Regards,
~Jackkisten
Copy link to clipboard
Copied
XPATH : XPath Syntax
evaluateXPathExpression:Adobe InDesign CS6 (8.0) Object Model JS: XMLElement
Sample codes all around…
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more