|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Rephrasing the problem [was Re: Second try: Search
Zack,
I figured it out just after sending... I was calling substring-before() and substring-after(), both of which convert a node to a string. An alternate (and more successful) way of doing what you want is to use d-o-e and CDATA sections, though it makes many XSLT'ers blood boil. Remember that d-o-e is not a mandatory option for an XSLT engine. <xsl:template name="linkify"> <xsl:param name="contents" select="/.."/> <xsl:param name="quote-names" select="/.."/> <xsl:choose> <xsl:when test="not($quote-names)"> <xsl:value-of select="$contents" disable-output-escaping="yes"/> </xsl:when> <xsl:when test="contains($contents, $quote-names[1]/@who)"> <xsl:call-template name="linkify"> <xsl:with-param name="contents"> <xsl:value-of select="substring-before($contents, $quote-names[1]/@who)" disable-output-escaping="yes"/> <xsl:value-of select="$quote-names[1]/@who"/> <xsl:text disable-output-escaping="yes"><![CDATA[ [<a href="people/]]></xsl:text> <xsl:value-of select="translate($quote-names[1]/@who, ' ', '_')"/> <xsl:text disable-output-escaping="yes"><![CDATA[.html">*</a>]]]></xsl:text> <xsl:value-of select="substring-after($contents, $quote-names[1]/@who)" disable-output-escaping="yes"/> </xsl:with-param> <xsl:with-param name="quote-names" select="$quote-names[position() > 1]"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="linkify"> <xsl:with-param name="contents" select="$contents"/> <xsl:with-param name="quote-names" select="$quote-names[position() > 1]"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> Greg Faron Integre Technical Publishing Co. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








