select.mediaobject.index — Selects the position of the appropriate media object from a list


<xsl:template name="select.mediaobject.index">
<xsl:param name="olist" select="imageobject|imageobjectco                      |videoobject|audioobject|textobject"/>
<xsl:param name="count">1</xsl:param>


This template takes a list of media objects (usually the children of a mediaobject or inlinemediaobject) and determines the "right" object. It returns the position of that object to be used by the calling template.

If the parameter use.role.for.mediaobject is nonzero, then it first checks for an object with a role attribute of the appropriate value. It takes the first of those. Otherwise, it takes the first acceptable object through a recursive pass through the list.

This template relies on a template named "is.acceptable.mediaobject" to determine if a given object is an acceptable graphic. The semantics of media objects is that the first acceptable graphic should be used.

If no acceptable object is located, no index is returned.



The node list of potential objects to examine.


The position in the list currently being considered by the recursive process.


Returns the position in the original list of the selected object.