Stuck with CFMX? XML trouble? Try this.
Crimson, the XML engine used by CFMX/CF6/CF6.1/whatever was old when CFMX came out. It was last updated in 2000 and abandoned with multiple bugs acknowledged and unfixed. We were running into issues with it in my current contract in mid-may (couple of boxes using CFMX because someone thinks they might have something customized that will break in 8 or 9) and I was asked to find a solution. A few false starts because the problem was unpredictable and simply stripping out extra whitespace seemed at first to fix the problem. Basically, the old XML parser reads your XML in chunks of, IIRC, 8000 characters. if the chunk ends inside a CDATA tag, it breaks. So by stripping whitespace we might have been moving the position of the cdata and making it not fail.
But to actually fix the problem, once it was finally diagnosed… difficult search, but happily, it turns out Brandon Purcell had the answer — you can change Coldfusion MX's XML parser to use Xerces.
One minor update to his post:
- The link for the version of Xerxes is bad — it's here now: http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip . I'm not sure if a newer version would work or not and I didn't want to risk it breaking if not. MX is using a very old version of java, too.
Filed by JC at June 6th, 2011 under Random