I would like to compare the search query to all the language titles of an asset which is stored on metadata node of the asset. So I tried to write an Xpath query like this but its not working.
Any suggestion on this.
Thanks and Regards
Views
Replies
Total Likes
Hi @VedhaSri ,
To check all the `title` properties in the metadata node of an asset using XPath, you can use the following query:
```
/jcr:content/metadata//*[local-name()='title']
```
This query selects all elements with a local name of `title` that are descendants of the `metadata` node under the `jcr:content` node of the asset.
To compare the search query to all the language titles of an asset, you can modify the query to include a predicate that filters the `title` elements based on their language attribute. For example, to select all `title` elements with a `language` attribute of `en`, you can use the following query:
```
/jcr:content/metadata//*[local-name()='title' and @language='en']
```
This query selects all `title` elements with a `language` attribute of `en` that are descendants of the `metadata` node under the `jcr:content` node of the asset.
You can replace `en` with the desired language code to select the `title` elements for that language. If you want to select all `title` elements regardless of their language, you can remove the `and @language='en'` predicate from the query.
Hi @HrishikeshKa, I tried the query but it is not working. could you please have look and I need to query all the titles at once.
HI @VedhaSri ,
You can write an Xpath query something like below. Here I've only mentioned for "es" but you can write as many as per your need.
/jcr:root/content/dam//element(*, dam:Asset)
[
(jcr:content/metadata/@dc:title_es = 'es-test' or jcr:content/metadata/@dc:title_en = 'en-test')
]
Thanks
tarun
Hi @TarunKumar , I wanted to query all the titles at once instead of adding all the titles individually as there are more than 30 language titles are there. Is that possible to query like that.
Views
Likes
Replies
Views
Likes
Replies