0
CDATA in RSS using Coldfusion
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/td-p/394632
Jul 09, 2006
Jul 09, 2006
Copy link to clipboard
Copied
I ma using Coldfusion 4.5 (yes I know it's old but it's what
I have to work with) to generate a dynmaic RSS feed. The problem I
have encounterd is that some of the fields (overview) inside the DB
have HTML in them, and even with the CDATA tags in place within the
Item/Description tags, it is blowing up. Is there any way to get it
to appear correctly?
<description><![CDATA[#overview#]]</description>
Thanks.
<description><![CDATA[#overview#]]</description>
Thanks.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394633#M35593
Jul 10, 2006
Jul 10, 2006
Copy link to clipboard
Copied
Can you describe what you mean by 'blowing up'?
looks like you're not closing your CDATA properly. Might need another '>' sign. Check out here for more on that:
http://www.dpawson.co.uk/xsl/sect2/cdata.html
you might consider this debate on CDATA vs. escaping the html characters:
http://www.sagewire.org/xml/CDATA-vs-Escaping-XML-Characters-233473.aspx
looks like you're not closing your CDATA properly. Might need another '>' sign. Check out here for more on that:
http://www.dpawson.co.uk/xsl/sect2/cdata.html
you might consider this debate on CDATA vs. escaping the html characters:
http://www.sagewire.org/xml/CDATA-vs-Escaping-XML-Characters-233473.aspx
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
djw808
AUTHOR
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394634#M35594
Jul 10, 2006
Jul 10, 2006
Copy link to clipboard
Copied
Typo on my behalf in the post above, it is definately entered
as
<description><![CDATA[#overview#]]></description>
The DB field (overview) contains:
Text
<ul>
<li><strong>text</strong></li>
<li><strong> text</strong></li>
</ul>
text<a hreflink.htm">Blah website</a> for further details.
The error it get is:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
An invalid character was found in text content. Error processing resource ' http://url/tenders.cfm'. Line 16, Position 46
<li><strong> text
<description><![CDATA[#overview#]]></description>
The DB field (overview) contains:
Text
<ul>
<li><strong>text</strong></li>
<li><strong> text</strong></li>
</ul>
text<a hreflink.htm">Blah website</a> for further details.
The error it get is:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
An invalid character was found in text content. Error processing resource ' http://url/tenders.cfm'. Line 16, Position 46
<li><strong> text
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394635#M35595
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
can you post a sample of the bad xml?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394636#M35596
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
sorry I missed your xml this morning... hadn't had my coffee
yet.
Save out the xml to a file, like test.xml, remove any reference to a stylesheet from the xml (if you have one in there), then open that file in IE. It should roughly pinpoint the invalid character. Any reason you couldn't htmlencode the value in the <description> node and leave out the CDATA?
Save out the xml to a file, like test.xml, remove any reference to a stylesheet from the xml (if you have one in there), then open that file in IE. It should roughly pinpoint the invalid character. Any reason you couldn't htmlencode the value in the <description> node and leave out the CDATA?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
djw808
AUTHOR
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394639#M35599
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
Can you please explain how I would htmlencode it instead of
using CDATA??
Thanks.
Thanks.
quote:
Originally posted by: sagewire
sorry I missed your xml this morning... hadn't had my coffee yet.
Save out the xml to a file, like test.xml, remove any reference to a stylesheet from the xml (if you have one in there), then open that file in IE. It should roughly pinpoint the invalid character. Any reason you couldn't htmlencode the value in the <description> node and leave out the CDATA?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394637#M35597
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
If you have access to Firefox, I find it better at detecting
bad markup
in the XML. It will put question marks in black diamonds where the
markup is questionable, but it will ontinue to display the rest of the
XML file instead of aborting at the first problem.
sagewire wrote:
> sorry I missed your xml this morning... hadn't had my coffee yet.
>
> Save out the xml to a file, like test.xml, remove any reference to a
> stylesheet from the xml (if you have one in there), then open that file in IE.
> It should roughly pinpoint the invalid character. Any reason you couldn't
> htmlencode the value in the <description> node and leave out the CDATA?
>
in the XML. It will put question marks in black diamonds where the
markup is questionable, but it will ontinue to display the rest of the
XML file instead of aborting at the first problem.
sagewire wrote:
> sorry I missed your xml this morning... hadn't had my coffee yet.
>
> Save out the xml to a file, like test.xml, remove any reference to a
> stylesheet from the xml (if you have one in there), then open that file in IE.
> It should roughly pinpoint the invalid character. Any reason you couldn't
> htmlencode the value in the <description> node and leave out the CDATA?
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394638#M35598
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
nm, your rss reader likely would just display the encoded
html. Sounds like your question really gets down to the xslt syntax
required to transform a cdata block.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394640#M35600
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
After thinking about it some more I don't think that
htmlencoding would help since it would end up garbled looking to
your human rss readers. The function I was thinking about is this
though: URLEncodedFormat
Anyway, check out your xslt file. I'm pretty sure that's where you'll find the problem. Try removing the cdata tag and put some valid xml or plain text inside your <description> node then try your transformation again. If it works, then ressearch using cdata inside an xslt.
good luck!
Anyway, check out your xslt file. I'm pretty sure that's where you'll find the problem. Try removing the cdata tag and put some valid xml or plain text inside your <description> node then try your transformation again. If it works, then ressearch using cdata inside an xslt.
good luck!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
djw808
AUTHOR
New Here
,
LATEST
/t5/coldfusion-discussions/cdata-in-rss-using-coldfusion/m-p/394641#M35601
Jul 11, 2006
Jul 11, 2006
Copy link to clipboard
Copied
Thanks I found the offending characters when viewing it in
firefox. It as an ms word generated ' and - that was causing the
problems. This leads me to another question though, is is possible
to use the "replace" function in Coldfusion to replace the
characters that the XML rejects in an RSS Feed? Is there a way of
listing all possibilites and the replacements for them in one hit?
Cheers.
Cheers.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

