Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

XHTML problems

I'm using CityDesk to generate XHTML 1.0 Transitional compliant documents. As a result, the requirements for formatting the HTML are much more stringent than if I were generating HTML 4.0.

I edit the templates and pages in HTML view out of necessity, because the WYSIWYG editor not only does not generate XHTML (not a big deal, really), but will actually strip out stuff if you even accidentally click on the Normal View button, thus making the document non-compliant. :(

One example is the <img> tag. I put in an image like so:

<img src="..." alt="..." width="..." height="..." />

Because it's XML, I must have the trailing /, and case is sensitive on all the HTML tags and attributes. Merely switching to Normal View and back, this gets converted to:

<IMG src="..." alt="..." width="..." height="..." >

Ouch. I presume what's doing it is whatever DHTML editor you're using, yes? Any chance they have a mode to preserve the XHTML tags properly? Oddly enough, it left other things alone with the trailing />, like the <meta> tags in the <head> section...

Brad Wilson
Wednesday, November 14, 2001

Actually, on second look, it also stripped out some of the (required) quotes on the attributes, so I ended up with:

<IMG src="..." alt="..." width=... height=... >

Brad Wilson
Wednesday, November 14, 2001

*  Recent Topics

*  Fog Creek Home