is there a way to access from a global template a value entered by the user into a related content item.
my global template looks for sys_window-title in the title tag. I have a content type that does not use this field - but an item that will be assembled into the content type does and i need to use that.
I am trying to use the solution below and this works fine if i want to select something that is actually displayed on the page. However, I need to access elements of the xml that are not displayed on the page and seem unable to do this.
Am i right in thinking that document() just gets the html of the displayed page? How do you access other xml elements of the related content page.
All you have to do is replace the .html with .xml but as XSL doesn’t have a standard replace function here’s one to put into your rx_resources/stylesheets/assemblers/rxs_global.xsl file.
<xsl:template name="replace">
<xsl:param name="string" select="''"/>
<xsl:param name="pattern" select="''"/>
<xsl:param name="replacement" select="''"/>
<xsl:choose>
<xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
<xsl:value-of select="substring-before($string, $pattern)"/>
<!--
Use "xsl:copy-of" instead of "xsl:value-of" so that users
may substitute nodes as well as strings for $replacement.
-->
<xsl:copy-of select="$replacement"/>
<xsl:call-template name="replace">
<xsl:with-param name="string" select="substring-after($string, $pattern)"/>
<xsl:with-param name="pattern" select="$pattern"/>
<xsl:with-param name="replacement" select="$replacement"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>