Home
TeamSite
XSL:substring methods in LS component?
Binettoid
Hi I am tryiing to use xsl substring-before and substring-after methods in a LiveSite component (TS 7.1) but my methods only produce empty strings.
For example, to get the current page name;
xsl:variable name="thisPage"
$PAGE_LINK[.] - outputs a long URL inc./sitename/index.page?
/xsl:variable
xsl:variable name="thisPageTwo" select="substring-after($thisPage,'sitename/')"/
xsl:variable name="thisPageLink" select="substring-before($thisPageTwo,'?')"/
Output from $thisPageLink is always empty.
Anyone know if these methods are supported, or if there is a special way of using this stuff?
Find more posts tagged with
Comments
Migrateduser
The tokens are replaced as content is streamed to the user; the absolute last thing done; after the xsl has been run. When your xsl is run the value for your thisPage variable is literally "$PAGE_LINK[.]".
Binettoid
Thanks again CyberPop, in my haste I forgot about the processing workflow. I'm guessing you don't know a way to do what I am trying to do here, or you would have said, but just to be sure: any idea how to make a component aware of what page it is sitting in?
Migrateduser
Have you tried $CONTEXT{pageName}
Other options are to set it in an external. Either set request attributes with the literal value you want to use or inject it into the xml output for use in the xslt. We are using both approaches.