[cascade:cdata] showing up in published XML
Hello:
I've got a transform that wraps the innards of certain nodes in
CDATA sections. Here's a snippet:
[cascade:cdata]
<xsl:copy-of select="./node()"/>
[/cascade:cdata]
The idea is to publish individual xml files to the webserver,
which is working pretty good. Except that
[cascade:cdata]
is appearing in the
published file. It's not showing up in the preview
in Cascade, though. Here's an example:
<wysiwyg-description>
<![CDATA[
[cascade:cdata]
Let's all eat lunch and then talk about stuff.
]]>
[/cascade:cdata]
</wysiwyg-description>
Thanks,
Greg
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 24 Aug, 2015 01:58 PM
Hi Greg,
Based on the second snippet, it looks like there are multiple
CDATA
tags in your output. When you have a moment, please attach your Format and sample XML so I can take a closer look in my local instance.Thanks!
2 Posted by Greg Gomez on 24 Aug, 2015 10:34 PM
Hi, Ryan:
Here you go:
And here's the template:
Thanks,
Greg
3 Posted by Greg Gomez on 24 Aug, 2015 11:25 PM
Hi, Ryan:
I updated the template to say this:
I realized that I didn't need the cascade-skip and pass-through nodes for this one.
Also, a little explanation might help you. What I'm trying to do is ensure that WYSIWYG Data Definition fields are wrapped in CDATA. It seems like the easiest way to do that is to name the fields something like wysiwyg-details, and then match nodes that begin with wysiwyg-. That way I don't have to update transforms every time somebody wants to add a new Data Definition or a WYSIWYG to an existing Data Definition (presuming that they name it correctly, beginning with wysiwyg-).
I hope that makes sense.
If you're aware of a better way to handle this situation, I would be interested to hear about it.
Thanks,
Greg
4 Posted by Greg Gomez on 25 Aug, 2015 12:03 AM
Hi, Ryan:
Another update. It appears that this is happening on assets that were created in the past, before I made some changes to the format, template, etc.. Although I can't see any differences between the old assets and newer ones, it does appear that newer assets are publishing correctly.
If you don't mind, can we keep this one open for a bit and I'll double check this assumption tomorrow.
Thanks,
Greg
5 Posted by Ryan Griffith on 25 Aug, 2015 03:19 PM
Thank you for the updates, Greg, please keep me posted on your findings.
Can you confirm if the actual WYSIWYG content contains
CDATA
tags or not?Thanks!
6 Posted by Greg Gomez on 25 Aug, 2015 05:43 PM
Hi, Ryan:
Heh, good question. If you mean did it get included in the text entered in the WYSIWYG field, then no.
I tried that myself just to see what happens. In HTML view, adding CDATA tags causes the wrapped text to disappear in the visual editor. Adding to the visual editor causes the angle brackets to be converted to entities.
Did I understand you correctly?
Thank you!
Greg
7 Posted by Ryan Griffith on 25 Aug, 2015 07:27 PM
Hi Greg,
The
CDATA
tags would be hidden in the visual editor since they are scripting related. I should clarify, if you open up the HTML editor for the WYSIWYG, do you see anyCDATA
tags in there?Thanks!
8 Posted by Greg Gomez on 25 Aug, 2015 09:21 PM
Hi, Ryan:
Nope.
Also, as I said, new pages appear to be publishing correctly. So, in other words, I did some fiddling and housekeeping, and things seem to be fine now. I'll confirm that as I go forward, but I think this one's resolved for now.
Although, the other issue with my JSON format generating no root element is back, so I may resurrect that thread.
You're always very helpful. Let me know if there's anything else you need from me.
Thanks!
Greg
9 Posted by Ryan Griffith on 26 Aug, 2015 03:07 PM
Thank you for following up, Greg, perhaps the issue is with some legacy content or something, which fixes itself when you update the content.
Make sure you have that
#cascade-skip
tag in your template and a bogus element around your DEFAULT region. This setup should resolve the root element problem.I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.
Have a great day!
Ryan Griffith closed this discussion on 26 Aug, 2015 03:07 PM.