Documentation
Search in ANCESTOR
usage
<SEARCH>
<element1>
<ANCESTOR [type="string"] [operator="exists/not_exists"]>
<element2>
...search criterion over element2...
</element2>
</ANCESTOR>
<ANCESTOR-OR-SELF [type="string"] [operator="exists/not_exists"]>
<element2>
...search criterion over element2...
</element2>
</ANCESTOR-OR-SELF>
...search criterion over element1...
</element1>
</SEARCH>
paramètres
type: the dependency type that links the elements. Can be a comma separated list of types.
retourne
<RESULTS>... Nectil elements ... </RESULTS>
Express conditions on the ancestors of the elements you are searching for. ANCESTOR-OR-SELF also includes the elements searched matched as ancestors in the result.
You want to express that an element (which you know about) is in the descendance (children, grandchildren, grand-grandchildren) of another element, at any depth.
Ex : find all medias contained in a Website, recursively.
exemples
<SEARCH>
<MEDIA mediatype="Page">
<ANCESTOR>
<MEDIA mediatype="Website"/>
</ANCESTOR>
</MEDIA>
</SEARCH>
Find the Pages that are the descendants of a Website, at any depth.
<SEARCH>
<MEDIA>
<ANCESTOR type="mediaNavigation,mediaContent">
<MEDIA ID="2"/>
</ANCESTOR>
<DESCRIPTIONS>keyword</DESCRIPTIONS>
</MEDIA>
</SEARCH>
Find all medias that contain a keyword and are the descendants of a media with ID=2, only using dependencies of type mediaNavigation and mediaContent.
<SEARCH>
<MEDIA>
<ANCESTOR>
<MEDIA ID="2"/>
</ANCESTOR>
<ANCESTOR>
<MEDIA ID="3"/>
</ANCESTOR>
</MEDIA>
</SEARCH>
Find all medias that are the descendants of a media with ID=2 OR with ID=3.
<SEARCH>
<MEDIA>
<ANCESTOR>
<MEDIA ID="2"/><MEDIA ID="3"/>
</ANCESTOR>
</MEDIA>
</SEARCH>
Find all medias that are the descendants of a media with ID=2 AND with ID=3.