OH cool!!  That's excellent.  I hadn't got to discovering XMLFormat yet.
And in reading about that function I've found a whole bunch of other
ColdFusion goodies related to XML too.

I confess to having 3000 pages of Ben Forta's books about CFMX and not
having read them all.   Actually I haven't read more than a quarter of them.


And thanks for your kind words, Ben.  Did I tell you how impressed I am with
your graphics project?  Your Aura project?   Top stuff.   I can't wait to
use it on a real live project.

Merry Christmas, Ben,  And thanks for all your help. 



Cheers
Mike Kear

-----Original Message-----
From: Ben Bishop [mailto:[EMAIL PROTECTED] 
Sent: Monday, 22 December 2003 6:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [WSG] Follow up (was: What have I missed here?)


Hi Mike,

Just on the ampersand issue (and in fairness to Peter, I'm just rewording
his post):

> I'm not sure about the ampersand.  It's a dynamic field
> coming form the
> client's inventory database and I don't think I'll be asking
> him to change
> his inventory and invoicing system just so it can please a
> web validator.

There's no change required to your client's data or systems, simply an extra
step at the ColdFusion display page level.

Same as when inserting data into the database you might replace/escape
single quotes to avoid SQL errors, when outputting DB content in your page
you should substitute characters reserved for XML with their HTML entity.
Eg: &quote; & < >

So rather than <cfoutput>#databasefield#</cfoutput>, you could use
<cfoutput>#xmlFormat(databasefield)#</cfoutput> to convert " ' & < > into
safe HTML entities. Or, just like Peter's example, you can write your own
function.

You keep data integrity, the code is valid and the browser displays the
expected character.

Kind regards and Christmas cheer,

Ben




*****************************************************
The discussion list for http://webstandardsgroup.org/
***************************************************** 

Reply via email to