Atlanta ASP.Net MVC Developer/ Architect
CDATA Section means nothing?
This is super simple but amazingly few developers know CDATA exists. About a year
ago I asked Burr Sutter what was all this CDATA
garbage in messages we were receiving from an (IBM) MQ feed. He told me and I
was stunned I had never heard of it before, I soon said “wow that’ll make my
XML driven interface so much easier in terms of having readable XML”. The XML in question
was full of < for < and > for > – in some cases I was storing
XML inside XML and that can get messy! Take a look at the little example below.. pretty
sweet eh?
<PaulsCDataExample>
<HardToEncodeString>Paul
Lockwood” <paul@d0tnetworkaholic.com></HardToEncodeString>
<EasyToEncodeString><![CDATA["Paul
Lockwood" <paul@d0tnetworkaholic.com>]]></EasyToEncodeString>
</PaulsCDataExample>
This is why contracting rules - there are always fresh faces to learn from. Last
night it dawned on me that casting a working ArrayList to an array [via ToArray(typeof)]
after parsing an input message/ config file is better than my
usual ‘smart’ approach of creating a strongly typed collection (assuming you are only
reading the data). A Thoughtmill guy educated me there – a few months back the use
of Factories really clicked thanks to an Innovative Architects employee. Now should
I feel stupid or educated?
| Print article | This entry was posted by Paul Lockwood on July 19, 2005 at 5:18 pm, and is filed under Other. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |