[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] hyperlinks
Can anyone please tell me how I can display the following XML <document> <title> hello world </title> <bodycopy> this is my uni web site <link>http://www.uts.edu.au/</link> </bodycopy> </document> into a sentence with the link as hyperlink. Cos at the moment the link tag info is just as CDATA. this is the XSL: <xsl:template match="*"> <xsl:choose> <xsl:when test="name()='title'"> <P class="bodytitle"><xsl:value-of select="."/></P> <xsl:apply-templates select="link"/> </xsl:when> <xsl:when test="name()='bodycopy'"> <xsl:choose> <xsl:when test="@type='numbered'"> <LI class="bodycopy"><xsl:value-of select="."/></LI> </xsl:when> <xsl:when test="@type='subtitle'"> <P class="bodycopy"><B><xsl:value-of select="."/></B></P> </xsl:when> <xsl:otherwise> <P class="bodycopy"><xsl:value-of select="."/></P> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> wrong input </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="link"> <xsl:variable name="ref" select="."/> <A href="{$ref}"><xsl:value-of select="."/></A> </xsl:template> I tried to put <xsl:apply-template select="link"/> somewhere in the "*" template, but all I get is the data between the <link> tag twice. One hyperlinked and the other just as text. rosa 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
|