Re: [xsl] HTML in xsl:variable

Subject: Re: [xsl] HTML in xsl:variable
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 13 Feb 2002 14:40:57 -0500
[Richard von Keyserling]

> I'm looking for a way to often used html code
> fragments in xsl variables.  if i use the html code as
> text i must escape the brackets -- which I can't seem
> to get back, upon transformation (using
> disable-output-escaping="no" doesn't change the
> reference back to the entitiy,  more over it escapes
> other chars like double quotes).
>
> I tried making it a node and callint the variable
> "string($var)" to no avail.
>
> I am now just using named templates to contain html
> fragments, but i would like to know if there is a way
> using xsl:variable
>

You can if your fragments are well-formed xml.  What are you trying to
accomplish?  Do you want a library of html tags that you insert onto the
output document?  If so, make them well-formed xml and use the "html" output
method.

If you want to get markup in the output, you shouldn't have to resort to
disabling output escaping.  But note, you will never get back any html
entities, like &nbsp;.  However, you won't have to, since if supplied as xml
they get converted into their corresponding character references, which the
browser will accept.

Cheers,

Tom P


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread