How to get NodeRef from XPath in Java?

cancel
Showing results for 
Search instead for 
Did you mean: 
mbel
Active Member II

How to get NodeRef from XPath in Java?

Jump to solution

Hello,

I have the following XPath as String which was previously converted as:

String xpath= this.nodeService.getPath(nodeRef).toPrefixString(namespaceService);

xpath is = > /app:company_home/st:sites/cm:test-site/cm:documentLibrary/cm:test.pdf

How I can convert the above Xpath to NodeRef?

Thank you in advance.

1 Solution

Accepted Solutions
mrks_js1
Established Member II

Re: How to get NodeRef from XPath in Java?

Jump to solution

Afaik there is no method that does this kind of 'conversion' -> My best guess is to use the xpath in a searchService query similar to what was posted here: SearchService.selectNodes(...) example  

View solution in original post

1 Reply
mrks_js1
Established Member II

Re: How to get NodeRef from XPath in Java?

Jump to solution

Afaik there is no method that does this kind of 'conversion' -> My best guess is to use the xpath in a searchService query similar to what was posted here: SearchService.selectNodes(...) example