c.resolveNode (id : string) : nodeset

The function resolveNode returns the xml node from the string reference originally created by generateId.

<xsl:variable name="id" select="c.generateId(root/element/@attribute)" />
<xsl:value-of select="c.resolveNode($id)" />

This function is often used for resolving the path for binary data. In one case, however, this only works under certain conditions. If the binary reference is an attribute in XML and the mimetype for example is to be queried after resolving the ID, then it does not work.

The following example shows a workaround for this case.

<xsl:stylesheet xmlns:reg="" xmlns:xsl="" xmlns:onion="" version="1.0">
<xsl:template match="/">
<xsl:variable name="ref" select="c.resolveNode('E0E0A2')" />
<xsl:variable name="mimeType">
<xsl:when test="count(reg:match($select, 'A\d', 'gi')) > 0">
<xsl:variable name="element" select="c.resolveNode(substring-before($select, 'A'))" />
<xsl:value-of select="$element/@*[local-name() = concat(local-name($ref), '.mimeType')]" />
<xsl:value-of select="$ref/@onion:mimeType" />