jason112
Site Admin
Posts: 347 Joined: Tue Oct 26, 2004 5:35 pm
Post
by jason112 » Thu Jul 31, 2008 9:48 am
In the XSL stylesheet try changing this line
<FONT SIZE="-1"><xsl:apply-templates select="UrlDisplay/child::node()"/></FONT>
To this
<FONT SIZE="-1"><xsl:value-of select="substring-before(UrlDisplay, '#')"/>/FONT>
dorban
Posts: 31 Joined: Fri Sep 24, 2004 12:39 pm
Post
by dorban » Thu Jul 31, 2008 10:20 am
If I run this...
<xsl:value-of select="Url"/>
It shows the full url. If I try...
<xsl:value-of select="UrlDisplay"/>
Nothing displays.
If I run...
<xsl:value-of select="substring-before(Url, '#')"/>
It fixes the issue with the one that has the "#" but doesn't display anything for all the urls that didn't have a "#" in them.
I was trying to see if I could check to see if the URL has a "#" and then optionally use either of the above. I tried this...
<xsl:variable name="Url">
<xsl:if test="contains(Url,'#')">
<xsl:value-of select="substring-before(Url, '#')"/>
</xsl:if>
<xsl:if test="not(contains(Url,'#'))">
<xsl:value-of select="Url"/>
</xsl:if>
</xsl:variable>
But it didn't work as I'd hoped. I know we're running an old version of the software. The HD in the appliance died and we restored from CD. We're outside of our 2 year contract for updates and have been trying to evaluate what we want to do for doc management. I was trying to build this as a POC for our new intranet. Any help is appreciated.
Thanks,
D.
jason112
Site Admin
Posts: 347 Joined: Tue Oct 26, 2004 5:35 pm
Post
by jason112 » Thu Jul 31, 2008 10:45 am
You should be able to do it with the logic of the 2nd one, just need some code tweaking.
<xsl:choose>
<xsl:when test="contains(Url,'#')">
<xsl:value-of select="substring-before(Url, '#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="Url"/>
</xsl:otherwise>
</xsl:choose>
dorban
Posts: 31 Joined: Fri Sep 24, 2004 12:39 pm
Post
by dorban » Thu Jul 31, 2008 10:48 am
Found what I was looking for. Just in case it helps someone else...
<xsl:param name="text" select="Url"/>
<xsl:param name="delim" select="'#'"/>
<xsl:choose>
<xsl:when test="contains($text,$delim)">
URL: <xsl:value-of select="substring-before($text,$delim)"/>
</xsl:when>
<xsl:otherwise>
URL: <xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>