Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: loosing html output in template

From: "Neil Smith [MVP Digital Media]" <neil@------.--->
To: NULL
Date: 10/7/2008 8:47:00 PM

Without the context (the original XML document) we can only guess what
your input looks like. However by selecting @MyNode it suggests you've
embedded all your "HTML" in some attribute, which really is not suited
to storing markup.

In any case, you would need to use <xsl:copy-of select="$MyVar" /> not
value-of (which copies only the text content of the parameter)


HTH
Cheers - Neil

On Tue, 7 Oct 2008 10:55:16 -0700 (PDT), ujjc001@g... wrote:

>I can't get my template to let me get html out of it...
>Here's the template
><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
>Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
>xmlns:fn="http://www.w3.org/2005/xpath-functions" >
>	<xsl:output method="html" version="1.0" encoding="UTF-8"
>indent="yes" />
>
>
><xsl:template name="replace">
><xsl:param name="string"/>
><xsl:choose>
><xsl:when test="contains($string,'&#xD;&#xA;')">
>    <span style="color:red;">
>      Top
>      <xsl:value-of select="substring-before($string,'&#xD;&#xA;')"/>
>      <BR />Bottom
>    </span>
>    <xsl:call-template name="replace">
>    <xsl:with-param name="string" select="substring-
>after($string,'&#xD;&#xA;')"/>
>    </xsl:call-template>
>    </xsl:when>
><xsl:otherwise>
>    <xsl:value-of select="$string"/>
></xsl:otherwise>
></xsl:choose>
></xsl:template>
>
>Here's how I use it later...
><xsl:variable name="MyVar">
><xsl:call-template name="replace">
><xsl:with-param name="text" select="@MyNode"/>
></xsl:call-template>
></xsl:variable>
><xsl:value-of select="$MyVar" />
>
>Make any note with "Blablabla&#xD;&#xA;secondlineblablabla"
>other things in my xsl will output html, but not in my template here.
>Top is shown, bottom is show and so is "blablabla... "  but I don't
>get any html output.
>
>Why can't I get html output inside this template??? I'm going crazy.
>Please help and let me know if you need more info.  Thanks again!
------------------------------------------------
Digital Media MVP : 2004-2008
http://mvp.support.microsoft.com/mvpfaqs


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent