Subject:Finding an alternative to disable-output-escaping Author:Nick Bond Date:15 Nov 2006 11:29 AM
Can anyone help me with this XSLT problem? I'm a novice so the solution may be obvious to you but I've been stuck on it for 2 days! It involves finding an alternative to using disable-output-escaping = "yes", as this method has stopped working since I switched my web hosting service. My old web host used PHP4 with Sabletron 1.0 and my new service uses PHP5 with libxslt Version 1.1.15
I'm building a simple CMS for a web site and am storing all the content in XML files. In particular I have a node value which contains HTML so it's stored as CDATA. Here's an example snippet of my XML...
Using my old set-up (Sabletron) the HTML output was unescaped and came out the way I wanted i.e.
<div><p>Hello world</p></div>
But with the new set-up the resulting HTML is...
<div><p>Hello world</p></div>
... obviously not what i want.
I've searched the web looking for alternatives to disable-output-escaping but can only find advice about not using it - no suggested alternatives. Is there a better way of getting that HTML from the XML node and outputting it 'as is' in the transformation??
Subject:Finding an alternative to disable-output-escaping Author:Nick Bond Date:15 Nov 2006 04:24 PM
Thanks James,
I just tried taking the html out of CData and then using xsl:copy-of and it worked! I'd hoped it would be that simple. I told you I was a novice didnt I? :)
Now i just have to validate the HTML when it goes into the XML and it's all good.