[thelist] Two XHTML validity questions in a CF site

Bruce Heerssen bheerssen at visualbridge.tv
Thu Jul 12 09:57:55 CDT 2001


Aaron Cole wrote:

> I've been desperately attempting to get my personal CF site to 
> validate under the XHTML 1.0 Transitional DOCTYPE.  Only two glitches 
> remain.
>
> 1) I use the ParagraphFormat CF function which adds a <P> to posts 
> every time the user enters two hard returns.  Obviously, the lack of a 
> closing tag isn't kosher.  Are there any alternatives?  Adding a <br 
> /> instead would be great. 

Maybe you could use "replace('your_string', chr(10), '<br />' 'All')"? 
You could also use "chr(13)". You just need to replace the new line or 
carriage return delimiter (or both if you want to be picky) with the <br 
/> tag. Then wrap the entire contents in <p></p> tags.

>
> 2) The Validator is not happy with the variables that I need to pass 
> in some of my hrefs.  Ideas to get around this?


I suspect the rule for XHTML is the same as for HTML, in this case. An 
ampersand in a URI (link) will throw an error because it siginifies an 
html entity. For valid HTML, you need to replace all ampersands with 
it's HTML entity (&amp;). Then the document should validate if there are 
no other errors.

HTH,

Bruce





More information about the thelist mailing list