Welcome to WebmasterWorld Guest from 23.22.17.192

Forum Moderators: open

Message Too Old, No Replies

XHTML in Dreamweaver

No more false PHP positive

   
5:14 am on Jan 19, 2002 (gmt 0)

10+ Year Member



Firstly, hi everyone. First post and stuff... :)

For a while now, I've been frustrated at the way Dreamweaver 4 handles XHTML documents, including its tendency to think that the XML declaration at the top of each document is a PHP tag.

Well, it seems as if I've found a way around it, and it's so simple I literally kicked myself for not seeing it earlier. To prevent DW4 from choking on the XML declaration, simply add comments around it, like this:

<!-- <?xml version="1.0"?> -->

After doing this, I thought, "hmm, I wonder if this will validate properly, though?" and went to the W3C's validator page. To my surprise, my page validated as XHTML 1.0 Transitional. (It validated before I added the comments, too).

This has certainly made the wait for Dreamweaver 5 a lot easier! Now I can properly see my page in DW4 without those yellow error tags everywhere, and only need to correct things such as <br /> and <img /> tags (which Dreamweaver doesn't add the end slash to).

3:00 pm on Jan 19, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to Webmaster World, Zaccix. And thanks for a helpful observation.
3:02 am on Feb 24, 2002 (gmt 0)

10+ Year Member



Thanks for the commenting tip!

At this site: [desiremedia.com...]

you can download a set of Configuration files for Dreamweaver 4 which are tweaked to write XHTML.

They are pretty good for things lkike the closing slash in empty elements like <img />.