Re: how to translate entities with XSL

Subject: Re: how to translate entities with XSL
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 8 Jun 2000 01:30:31 -0600 (MDT)
> I have an XML document with HTML embedded within the element attributes.
>  An example of one of the elements would be:
> <row html="example output&lt;BR&gt;">

Bad form. Use XHTML in the element content.

  <xhtml>example output<br/></xhtml>

Then instead of <xsl:value-of select="@html"/> which I assume you're
using, use <xsl:copy-of select="xhtml/node()"/>. If node() is not working,
"xhtml/*|xhtml/text()|xhtml/comment()|xhtml/processing-instruction()" ...
sorry I can't answer with certainty but I don't use MSXML.

> I am trying to use XSL to insert these chunks of HTML into an HTML document,
> however, I cannot figure out how to get the entities translated back into
> "<" and ">".  Any ideas on how to do this?  I am using MSXML, so that puts a
> limit on what XSL tags I can use.

If using XHTML in the XSL, and <xsl:output method="html"/> cannot be used
to get the results you want, then you are using the wrong tools for the
job. XSL(T) is a node tree transformation language, not a language for
serially pasting together strings of arbitrary text and calling it HTML.
If you need that, there's ASP, JSP, PHP, Cold Fusion, server-side
includes, etc.

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread