Documentation
Search in DESCENDANT
usage
<SEARCH>
<element1>
<DESCENDANT [type="string"] [operator="exists/not_exists"]>
<element2>
...search criterion over element2...
</element2>
</DESCENDANT>
<DESCENDANT-OR-SELF [type="string"] [operator="exists/not_exists"]>
<element2>
...search criterion over element2...
</element2>
</DESCENDANT-OR-SELF>
...search criterion over element1...
</element1>
</SEARCH>
paramètres
type: the types of dependencies (separated by commas) we want to travel through in search for the element indicated inside the DESCENDANT node.
operator: if we want the element to have or NOT to have such a descendant
retourne
<RESULTS>... Nectil elements ... </RESULTS>
Express conditions on the descendance of the elements you are searching for.
You want to express that an element contains another element (which you know about) wherever in its descendance (children, grandchildren, grand-grandchildren).
Ex1 : find the media ancestor of type Book of a specific element Paragraph, knowing that Paragrah can contain other Paragraphs, recursively.
Ex2 : find the Website that contains a known Page, knowing that Websites contain Menus, which contain Submenus, which contain Pages.
exemples
<SEARCH>
<MEDIA mediatype="Website">
<DESCENDANT>
<MEDIA ID="709"/>
</DESCENDANT>
</MEDIA>
</SEARCH>
Find the Website that contains the Media with ID=709
<SEARCH>
<MEDIA mediatype="Menu">
<DESCENDANT>
<MEDIA>
<INFO>
<MEDIATYPE>ContactForm</MEDIATYPE>
</INFO>
</MEDIA>
</DESCENDANT>
</MEDIA>
</SEARCH>
Find the Menus that contains a Media of type ContactForm
<SEARCH>
<MEDIA mediatype="Website">
<DEPENDENCIES>
<MEDIA mediatype="Menu">
<DESCENDANT type="mediaContent,mediaNavigation">
<MEDIA ID="709" />
</DESCENDANT>
</MEDIA>
</DEPENDENCIES>
</MEDIA>
</SEARCH>
Find the Website that has a dependencies to a Menu that contains the Media with ID=709, only passing through the dependencies with a type mediaNavigation or mediaContent.
<SEARCH name="doc-tree">
<MEDIA mediatype="documentation_center">
<DESCENDANT-OR-SELF>
<MEDIA ID="25"/>
</DESCENDANT-OR-SELF>
</MEDIA>
<RETURN depth="1">
<INFO>
<MEDIATYPE/>
</INFO>
<DESCRIPTION discard-element-if="absent">
<TITLE/>
</DESCRIPTION>
</RETURN>
</SEARCH>
Retrieve medias having a descendant with the ID 25, or this media if it is a documentation_center.