You can get a set of all nodes that reference the node like this:
<!-- This is the call that returns the nodes element - change that to how you're actually getting the Examine result -->
<xsl:variable name="result" select="custom:search('something')" />
<!-- Reference to site's root -->
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<!-- Find the Material node(s) that reference any node returned from the search -->
<xsl:variable name="theyPickedMe" select="$siteRoot//Material[materialParts//nodeId = $result//node/@id]" />
<!-- Render some output -->
<xsl:apply-templates select="$theyPickedMe" />
<!-- Template for Material output -->
<xsl:template match="Material">
<p><xsl:value-of select="@nodeName" /> : <xsl:value-of select="@id" /></p>
</xsl:template>
The important part is that you get a set - so if your search results in more than one node, you can get them all at once - if they're not all Material nodes just change the Material pattern to the more generic document selector: *[@isDoc].
Finding Search Id in Multinode Tree Picker
Hi,
When using the examine search I get this XML (simplified):
The object, 1394, might be picked by a Multinode Tree Picker, like this:
How do I get the Id of <Material> 1116?
Hi Daniel,
You can get a set of all nodes that reference the node like this:
The important part is that you get a set - so if your search results in more than one node, you can get them all at once - if they're not all Material nodes just change the Material pattern to the more generic document selector:
*[@isDoc]
.Hope that helps,
/Chriztian
Thanks Chriztian, that worked like a charm.
is working on a reply...