tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/6668-working-with-cdata-in-xml-and-xsltCascade CMS: Discussion 2016-04-27T20:47:04Ztag:help-archives.hannonhill.com,2010-02-09:Comment/396010982016-04-08T18:03:55Z2016-04-08T18:03:55ZWorking with CDATA in XML and XSLT<div><p>Hi Ray,</p>
<p>I am wondering if perhaps the XPath just needs some tweaking.
When you have a moment, please attach your Format and sample XML so
I can do some local testing.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/396010982016-04-08T18:22:58Z2016-04-08T18:23:01ZWorking with CDATA in XML and XSLT<div><p>@Ryan Griffith</p>
<p>I have included the sample results, XML and XSLT all in one
file.</p>
<p>Thanks for your help</p></div>Raytag:help-archives.hannonhill.com,2010-02-09:Comment/396010982016-04-08T20:13:39Z2016-04-08T20:13:39ZWorking with CDATA in XML and XSLT<div><p>Hi Ray,</p>
<p>Thank you for attaching the sample file.</p>
<p>Unfortunately, the main issue here is the XML is within CDATA
which isn't really meant to be parsed. During testing, I was able
to get the HTML within the CDATA, but was unsuccessful in parsing
it.</p>
<p>Thinking about this a bit, what you could possibly do is output
the XML that is within the CDATA in a temporary
<code><div></code> with a specific class name and then attach
an XSLT Format at the page, template or configuration set level
that processes the XML within those hidden <code><div></code>
tags and outputs the desired HTML.</p>
<p>So basically you are processing the content twice, once to
generate XML elements and again to actually process it. I've
attached two Formats that appear to do the trick given your sample
XML. A variation of the <strong>first_format.xml</strong> would be
applied to your page region and the <strong>second_format</strong>
would be applied at the page, template or configuration set
level.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffith