Expand my Community achievements bar.

xpath query to search for text "/wordprefixedwithslash" in entire content structure i.e. pages?

Avatar

Level 2

Need to search for "/wordprefixedwithslash" text in content tree so that all these matches can be replaced with "/someotherwordprefixedwithslash".

So that the search query do not matches only text "wordprefixedwithslash" in content structure.

 

Tried with 

"/jcr:root/content/websitepath//element(*, nt:hierarchyNode)[jcr:contains(jcr:content, '/wordprefixedwithslash')]" 

but it's returning all nodes where we have "wordprefixedwithslash" even though our goal is to search for pages having "/wordprefixedwithslash" in content.[Please note "/"]

 

The issue is that "/" is not getting considered in search.

 

Any idea or suggestion will be helpful.

CQ5 version : - CQ 5.6

2 Replies

Avatar

Level 10

did you try with '//' (with the escape character)

Avatar

Level 2

Yes bsloki, tried with that, but it do not seems to be making any impact.