CFXML - What am I doing wrong
Can somebody tell me what's wrong with this code? I have a podcast that uses exactly the same format (with different tags, obviously) and works fine. With this one, however, I am simply trying to create a basic feed and I continue to get this error: An error occured while Parsing an XML document. An invalid XML character (Unicode: 0x1c) was found in the element content of the document. The error occurred in updatefeed.cfm: line 32 30 :/item 31 :/cfoutput 32 :/cfloop 33 : /channel 34 : /rss Here is my code: cfquery name=Post datasource=#request.dsn# SELECT * FROM Posts ORDER BY PostDate Desc LIMIT 10 /cfquery CFXML VARIABLE=EDXML casesensitive=no rss version=2.0 channel titleExist~Dissolve/title linkhttp://www.existdissolve.com//link descriptionThe Singularity of Being and Nothingness/description languageen-us/language pubDatecfoutput#Post.PostDate#/cfoutput/pubDate lastBuildDateWed, 04 Apr 2007 09:41:01 GMT/lastBuildDate webMaster[EMAIL PROTECTED]/webMaster cfloop query=Post cfoutput item title#Post.PostTitle#/title linkhttp://existdissolve.com/index.cfm?postid=#Post.ID#/link description#Post.PostContent#/description pubDate#LSDateFormat(Post.PostDate, 'ddd, dd mmm ' )# #TimeFormat(Post.PostDate, 'HH:mm:ss')# GMT/pubDate guidhttp://existdissolve.com/index.cfm?postid=#Post.ID#/guid /item /cfoutput /cfloop /channel /rss /cfxml cffile action=write file=#ExpandPath('existdissolvefeed.xml')# output=#ToString(EDXML)# cflocation url=index.cfm Thanks! Joel ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274704 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFXML - What am I doing wrong
Looks like you've got a #chr(28)# somewhere in your content. That's not a legal character in an XML doc, so you have to escape it somehow. cheers, barneyb On 4/6/07, Joel Watson [EMAIL PROTECTED] wrote: Can somebody tell me what's wrong with this code? I have a podcast that uses exactly the same format (with different tags, obviously) and works fine. With this one, however, I am simply trying to create a basic feed and I continue to get this error: An error occured while Parsing an XML document. An invalid XML character (Unicode: 0x1c) was found in the element content of the document. The error occurred in updatefeed.cfm: line 32 30 :/item 31 :/cfoutput 32 :/cfloop 33 : /channel 34 : /rss Here is my code: cfquery name=Post datasource=#request.dsn# SELECT * FROM Posts ORDER BY PostDate Desc LIMIT 10 /cfquery CFXML VARIABLE=EDXML casesensitive=no rss version=2.0 channel titleExist~Dissolve/title linkhttp://www.existdissolve.com//link descriptionThe Singularity of Being and Nothingness/description languageen-us/language pubDatecfoutput#Post.PostDate#/cfoutput/pubDate lastBuildDateWed, 04 Apr 2007 09:41:01 GMT/lastBuildDate webMaster[EMAIL PROTECTED]/webMaster cfloop query=Post cfoutput item title#Post.PostTitle#/title linkhttp://existdissolve.com/index.cfm?postid=#Post.ID#/link description#Post.PostContent#/description pubDate#LSDateFormat(Post.PostDate, 'ddd, dd mmm ' )# #TimeFormat(Post.PostDate, 'HH:mm:ss')# GMT/pubDate guidhttp://existdissolve.com/index.cfm?postid=#Post.ID#/guid /item /cfoutput /cfloop /channel /rss /cfxml cffile action=write file=#ExpandPath('existdissolvefeed.xml')# output=#ToString(EDXML)# cflocation url=index.cfm Thanks! Joel ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274705 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFXML - What am I doing wrong
Ensure you XMLFormat() everything. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Barney Boisvert To: CF-Talk Sent: Fri Apr 06 19:23:34 2007 Subject: Re: CFXML - What am I doing wrong Looks like you've got a #chr(28)# somewhere in your content. That's not a legal character in an XML doc, so you have to escape it somehow. cheers, barneyb On 4/6/07, Joel Watson [EMAIL PROTECTED] wrote: Can somebody tell me what's wrong with this code? I have a podcast that uses exactly the same format (with different tags, obviously) and works fine. With this one, however, I am simply trying to create a basic feed and I continue to get this error: An error occured while Parsing an XML document. An invalid XML character (Unicode: 0x1c) was found in the element content of the document. The error occurred in updatefeed.cfm: line 32 30 :/item 31 :/cfoutput 32 :/cfloop 33 : /channel 34 : /rss Here is my code: cfquery name=Post datasource=#request.dsn# SELECT * FROM Posts ORDER BY PostDate Desc LIMIT 10 /cfquery CFXML VARIABLE=EDXML casesensitive=no rss version=2.0 channel titleExist~Dissolve/title linkhttp://www.existdissolve.com//link descriptionThe Singularity of Being and Nothingness/description languageen-us/language pubDatecfoutput#Post.PostDate#/cfoutput/pubDate lastBuildDateWed, 04 Apr 2007 09:41:01 GMT/lastBuildDate webMaster[EMAIL PROTECTED]/webMaster cfloop query=Post cfoutput item title#Post.PostTitle#/title linkhttp://existdissolve.com/index.cfm?postid=#Post.ID#/link description#Post.PostContent#/description pubDate#LSDateFormat(Post.PostDate, 'ddd, dd mmm ' )# #TimeFormat(Post.PostDate, 'HH:mm:ss')# GMT/pubDate guidhttp://existdissolve.com/index.cfm?postid=#Post.ID#/guid /item /cfoutput /cfloop /channel /rss /cfxml cffile action=write file=#ExpandPath('existdissolvefeed.xml')# output=#ToString(EDXML)# cflocation url=index.cfm Thanks! Joel ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274707 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFXML - What am I doing wrong
Either use XMLFormat() or wrap dynamic data in a CDATA block: description![CDATA[#Post.PostContent#]]/description I prefer the latter simply because it's native XML and doesn't perform any conversion of my data. Either should work perfectly well, though. On 4/6/07, Joel Watson [EMAIL PROTECTED] wrote: Can somebody tell me what's wrong with this code? I have a podcast that uses exactly the same format (with different tags, obviously) and works fine. With this one, however, I am simply trying to create a basic feed and I continue to get this error: An error occured while Parsing an XML document. An invalid XML character (Unicode: 0x1c) was found in the element content of the document. The error occurred in updatefeed.cfm: line 32 30 :/item 31 :/cfoutput 32 :/cfloop 33 : /channel 34 : /rss Here is my code: cfquery name=Post datasource=#request.dsn# SELECT * FROM Posts ORDER BY PostDate Desc LIMIT 10 /cfquery CFXML VARIABLE=EDXML casesensitive=no rss version=2.0 channel titleExist~Dissolve/title linkhttp://www.existdissolve.com//link descriptionThe Singularity of Being and Nothingness/description languageen-us/language pubDatecfoutput#Post.PostDate#/cfoutput/pubDate lastBuildDateWed, 04 Apr 2007 09:41:01 GMT/lastBuildDate webMaster[EMAIL PROTECTED]/webMaster cfloop query=Post cfoutput item title#Post.PostTitle#/title linkhttp://existdissolve.com/index.cfm?postid=#Post.ID#/link description#Post.PostContent#/description pubDate#LSDateFormat(Post.PostDate, 'ddd, dd mmm ' )# #TimeFormat(Post.PostDate, 'HH:mm:ss')# GMT/pubDate guidhttp://existdissolve.com/index.cfm?postid=#Post.ID#/guid /item /cfoutput /cfloop /channel /rss /cfxml cffile action=write file=#ExpandPath('existdissolvefeed.xml')# output=#ToString(EDXML)# cflocation url=index.cfm Thanks! Joel ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274709 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFXML - What am I doing wrong
I tried wrapping all the dynamic sections in the CDATA as you showed. Now, I am getting this error: An invalid XML character (Unicode: 0x1c) was found in the CDATA section. Any more ideas? Thanks! Either use XMLFormat() or wrap dynamic data in a CDATA block: description![CDATA[#Post.PostContent#]]/description I prefer the latter simply because it's native XML and doesn't perform any conversion of my data. Either should work perfectly well, though. On 4/6/07, Joel Watson [EMAIL PROTECTED] wrote: ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274713 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFXML - What am I doing wrong
An invalid XML character (Unicode: 0x1c) was found in the CDATA section. Here is a regex I use to clean my xml of any funky characters: cfset newxml = rereplace(oldxml, [\x00-\x1f], , All) Then you should probably still CDATA newxml to escape the regular bad xml characters. -- Josh ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274715 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFXML - What am I doing wrong
I'm really new to xml--- Where exactly are you doing this cleaning? An invalid XML character (Unicode: 0x1c) was found in the CDATA section. Here is a regex I use to clean my xml of any funky characters: cfset newxml = rereplace(oldxml, [\x00-\x1f], , All) Then you should probably still CDATA newxml to escape the regular bad xml characters. -- Josh ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274718 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFXML - What am I doing wrong
I'm really new to xml--- Where exactly are you doing this cleaning? Sorry, I should have been more clear -- What I do is wrap the outputted xml in cfsavecontent, before wrapping the cfxml tag around it. This results in a string which in my example is oldxml. For example: cfsavecontent variable=oldxml cfoutput query=myquery item#item#/item /cfoutput /cfsavecontent Then you clean the string oldxml and then wrap it with the cfxml tag. -- Josh - Original Message - From: Joel Watson [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, April 06, 2007 12:06 PM Subject: Re: CFXML - What am I doing wrong An invalid XML character (Unicode: 0x1c) was found in the CDATA section. Here is a regex I use to clean my xml of any funky characters: cfset newxml = rereplace(oldxml, [\x00-\x1f], , All) Then you should probably still CDATA newxml to escape the regular bad xml characters. -- Josh ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274724 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFXML - What am I doing wrong
No real reason to use the cfxml tag if you are using cfsavecontent. May as well keep it as text and then XMLParse() it. Or you could just use cfxml straight off the bat. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Josh Nathanson To: CF-Talk Sent: Fri Apr 06 20:26:52 2007 Subject: Re: CFXML - What am I doing wrong I'm really new to xml--- Where exactly are you doing this cleaning? Sorry, I should have been more clear -- What I do is wrap the outputted xml in cfsavecontent, before wrapping the cfxml tag around it. This results in a string which in my example is oldxml. For example: cfsavecontent variable=oldxml cfoutput query=myquery item#item#/item /cfoutput /cfsavecontent Then you clean the string oldxml and then wrap it with the cfxml tag. -- Josh - Original Message - From: Joel Watson [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, April 06, 2007 12:06 PM Subject: Re: CFXML - What am I doing wrong An invalid XML character (Unicode: 0x1c) was found in the CDATA section. Here is a regex I use to clean my xml of any funky characters: cfset newxml = rereplace(oldxml, [\x00-\x1f], , All) Then you should probably still CDATA newxml to escape the regular bad xml characters. -- Josh ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274726 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CFXML - What am I doing wrong
Okay, I wasn't exactly able to get this to work. What I finally did was go into my database and scrub my files of all terrible characters (not a good, long-term solution). So, perhaps I need to figure out how to get the data into the database clean before I try to write it to an XML file... Anybody know of a good regex to do that? Thanks I'm really new to xml--- Where exactly are you doing this cleaning? Sorry, I should have been more clear -- What I do is wrap the outputted xml in cfsavecontent, before wrapping the cfxml tag around it. This results in a string which in my example is oldxml. For example: cfsavecontent variable=oldxml cfoutput query=myquery item#item#/item /cfoutput /cfsavecontent Then you clean the string oldxml and then wrap it with the cfxml tag. -- Josh - Original Message - From: Joel Watson [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, April 06, 2007 12:06 PM Subject: Re: CFXML - What am I doing wrong ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274735 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CFXML - What am I doing wrong
I didn't follow every post in the thread, but have you been using xmlformat() for all your data as you build your xml? I have gotten great milage out of that function. ~Brad -Original Message- From: Joel Watson [mailto:[EMAIL PROTECTED] Sent: Friday, April 06, 2007 4:00 PM To: CF-Talk Subject: Re: CFXML - What am I doing wrong Okay, I wasn't exactly able to get this to work. What I finally did was go into my database and scrub my files of all terrible characters (not a good, long-term solution). So, perhaps I need to figure out how to get the data into the database clean before I try to write it to an XML file... Anybody know of a good regex to do that? Thanks ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274737 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4