Page 1 of 1

findNodesByXPath within referenced content not working

Posted: Mon May 19, 2014 12:51 pm
by Patrik
Hi,

from within my reference resolver I'm using the method AuthorDocumentController.findNodesByXPath() and this usually works fine. However, when I include this file with xinclude in another file the reference can no more be resolved because findNodesByXPath returns an empty array. My xpath is something like "ancestor::MyNodeName". Is this a known limitation or did I do anything wrong?

Thanks and regards,

Patrik

Re: findNodesByXPath within referenced content not working

Posted: Tue May 20, 2014 11:55 am
by alex_jitianu
Hi Patrik,

Unfortunately xincluded sections are no transparent to findNodesByXPath (and for that matter to any XPath execution API). If the expression is simple enough I think you could just iterate yourself on the Author nodes model (at least for getting an ancestor it should be simple enough). I'll add an issue to consider treating the XInclude as transparent.

Best regards,
Alex

Re: findNodesByXPath within referenced content not working

Posted: Wed May 21, 2014 11:41 am
by Patrik
Hi Alex,

as you suggested I implemented my own "interpreter" when the xpath matches "ancestor:<NodeName>" and it works fine now. Thanks.

Patrik