Josh Nathanson wrote:
---
An error occured while Parsing an XML document.
An invalid XML character (Unicode: 0x1c) was found in the element content of
the document.
--
The values in question are text strings entered by users and could contain
tabs, carriage
I found CFXML a real pain to get all the whitespace etc out...even with
CFSILENT
..or even worse...all on one line. I opted for the object method for
producing XML...less obvious but far tighter IMHO
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems
characters that the
user had entered somehow. Also added chr(38) which is the '' character,
also a baddie.
-- Josh
- Original Message -
From: Jochem van Dieten [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Monday, April 10, 2006 2:31 AM
Subject: Re: Bad character crashing cfxml
All, thanks for the help with this issue. Using CDATA
didn't work as apparently CF does parse whatever's
within the CDATA block and was still choking on the
bad character. I ultimately implemented the rereplace
suggested by S. Isaac, and after some tweaking it
worked. Here's the final
Hello All,
When creating an xml document using cfxml, I get the following 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 values in question are text strings
I opt to store user-defined data in CDATA blocks:
root
mytag![CDATA[#userDefinedStuff#]]/mytag
/root
Another route is to use the XMLFormat() function.
On 4/9/06, Josh Nathanson [EMAIL PROTECTED] wrote:
Hello All,
When creating an xml document using cfxml, I get the following error:
use cdata?
If you ever have characters that could make the xml mis-formed,
especially all user entered data, put it in a cdata.
root
node![CDATA[
my ' bad / data
]]/node
/root
That will parse just fine.
http://www.w3schools.com/xml/xml_cdata.asp
On 4/9/06, Josh Nathanson [EMAIL
I opt to store user-defined data in CDATA blocks:
root
mytag![CDATA[#userDefinedStuff#]]/mytag
/root
Another route is to use the XMLFormat() function.
Unfortunately the XMLFormat() function doesn't handle non-printing
characters. I believe the character 0x1C or 1C is ASCII character
Message -
From: S. Isaac Dealey [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Sunday, April 09, 2006 5:20 PM
Subject: Re: Bad character crashing cfxml
I opt to store user-defined data in CDATA blocks:
root
mytag![CDATA[#userDefinedStuff#]]/mytag
/root
Another route
mystring =
rereplace(mystring,[#chr(1)#-#chr(8)##chr(11)#-#chr(12)##chr(14)#-#chr(31)#],,ALL);
The only problem with this is that that you have to add stuff that you want
removed.
You could also list what's allowed, vs. what's not allowed, like
cffunction name=safeString returntype=string
mystring =
rereplace(mystring,[#chr(1)#-#chr(8)##chr(11)#-#chr(12)##
chr(14)#-#chr(31)#],,ALL);
The only problem with this is that that you have to add
stuff that you want
removed.
You could also list what's allowed, vs. what's not
allowed, like
cffunction name=safeString
11 matches
Mail list logo