Subject: Re: [xsl] xsl:variable containing xsl:element From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 29 Jan 2001 09:41:16 GMT |
The string contains HTML code If you think of HTML (or XML) markup being part of a string you'll always get confused by XSLT. XSLT (unlike, say perl) does not work on the string representation of an XML document, but on a tree representation. // This doesn't work - displays the number BUT not bold <xsl:variable name="wholestring">This is my account <xsl:element name="b">123.456</xsl:element> now closed</xsl:variable> <xsl:value-of select="string($wholestring)"/> as mentioned before, both string() and value-of() are doing the same thing here, giving the string value of the expreesion, which will throw away any element nodes. The reason for the variable is that I want to pass it to another template using <xsl:call-template name="getConfirmationPage"> <xsl:with-param name="Header" select="Title/Text"/> <xsl:with-param name="Title" select="$wholestring"/> </xsl:call-template> That in itself isn't a reason, you could just use <xsl:with-param name="Title" >This is my account <b>123.456</b> now closed</xsl:with-param> you don't need a variable if it's only used there. > The <xsl:copy-of select="$wholestring"/> throws the following error It shouldn't. Are you sure you have that line somewhere in the scope of the wholestring variable (that is, in teh same template) David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. For further information visit http://www.star.net.uk/stats.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl:variable containing xsl:e, MUELLER,RAINER (HP-S | Thread | RE: [xsl] xsl:variable containing x, Michael Kay |
[xsl] xsl:variable containing xsl:e, MUELLER,RAINER (HP-S | Date | RE: [xsl] xsl:variable containing x, Michael Kay |
Month |