findNodesByXPath within referenced content not working

Post here questions and problems related to oXygen frameworks/document types.
Patrik
Posts: 264
Joined: Thu Nov 28, 2013 9:32 am
Location: Hamburg/Germany
Contact:

findNodesByXPath within referenced content not working

Post by Patrik » Mon May 19, 2014 12:51 pm

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

alex_jitianu
Posts: 793
Joined: Wed Nov 16, 2005 11:11 am

Re: findNodesByXPath within referenced content not working

Post by alex_jitianu » Tue May 20, 2014 11:55 am

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

Patrik
Posts: 264
Joined: Thu Nov 28, 2013 9:32 am
Location: Hamburg/Germany
Contact:

Re: findNodesByXPath within referenced content not working

Post by Patrik » Wed May 21, 2014 11:41 am

Hi Alex,

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

Patrik

Post Reply