xsl-list
[Top] [All Lists]

RE: De-escaping markup

2005-02-03 04:43:33
One approach is to serialize the content without escaping it:

<xsl:value-of select="CONTENT" disable-output-escaping="no"/>

A more flexible approach is to parse the content into a proper tree,
allowing the structured content to be manipulated:

<xsl:variable name="subtree" select="saxon:parse(CONTENT)"/>

Neither approach is 100% portable.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: ben(_dot_)pickering(_at_)marketing(_dot_)net(_dot_)uk 
[mailto:ben(_dot_)pickering(_at_)marketing(_dot_)net(_dot_)uk] 
Sent: 03 February 2005 11:11
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] De-escaping markup

Hi

I have a bit of a problem in that a system out of my control 
is producing 
"markup" looking like the following:

<CONTENT>
        This is &lt;b&gt;bold&lt;/b&gt;
</CONTENT>

i.e., with all the perfectly good markup escaped. 

I was wondering if anyone knows of a stylesheet which will 
convert text 
nodes like this into proper markup, for a whole document.  
The above would 
come out like:

<CONTENT>
        This is <b>bold</b>
</CONTENT>

Ideally it would operate on nested tags, as the system (which 
will remain 
nameless) is also breaking my <table>s.

Thanks for any help.
Cheers,
Ben.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>