Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5

Thread: XHTML Woes

  1. #1
    Member mark4man's Avatar
    Join Date
    Aug 2003
    Posts
    65
    Member #
    2599
    In my reconstructed site (in which I basically took most of the graphic content from my old site; & rebuilt a new site, from scratch, in DW), I made the mistake of creating all my pages as XHTML Compliant. When validated, there were hundreds of mistakes.

    Worse yet, the most important page, which contains a PayPal button linking to a purchase form at PayPal, did not work at all...& the error was related to (you guessed it), XHTML!!!

    Out of frustration (& not being able to find an answer as how to convert back to regular, average, everyday, ordinary HTML in the discussion groups), I compared, through DW's Preferences dialog, new HTML 4.01 page templates, which were coded as follows:

    ----------------------------------------------------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>

    </body>
    </html>
    ----------------------------------------------------------------------------

    with new XHTML page templates, which were coded as follows:

    ----------------------------------------------------------------------------
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>

    <body>
    </body>
    </html>
    ----------------------------------------------------------------------------

    And for the page that didn't work, I changed the DTD's (& all tags prior to <head>) from the second (XHTML) to the first (HTML)...

    ...AND NOW THE PAGE WORKS FINE!

    So, my questions are:

    1) Did I do the right thing?...& can I do the same thing with the rest of my pages in order to convert back to HTML...

    ...or...

    2) Is converting back more complex than this (realizing that perhaps as DW created my pages as XHTML compliant, the code for each entire page was written as XHTML)?

    ...&...

    3) If this is the case, how can I easily & correctly convert the pages back to HTML?

    Thanks,

    mark4man

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Actually what you did isn't quite right... The idea of XHTML is that it's a special "form" of XML with allowed tags and whatnot. The first line of all your documents (<?xml...) says that it is XML and will not be validated unless it's compared against a proper DTD (XHTML for instance) I have never had any problems related to XHTML... But if you want to change back to regular HTML 4.0 transitional, get rid of the <?xml... tags at the beginning of all your documents. Then it wont be validated against xml's rules.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Member Black Vivi's Avatar
    Join Date
    Apr 2003
    Location
    UK
    Posts
    75
    Member #
    1072
    the only problem i've ever had with XHTML is image maps, because the name attribute isn't allowed
    everything else worked fine when i used id and went to an anchor in a page
    it might just happen in firebird tho, cos i dont remember ever going to an anchor in a page when it's meant to...
    Download Firebird now!

  5. #4
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    name attribute is allowed for map tags. I'm using it on one of my sites and seems to be validated without a problem.

    www.webspacegurus.com
    http://validator.w3.org/check?uri=ht...cegurus.com%2F

    According to w3school's reference, name attribute is optional for map tags, but is supported in all three DTD's, strict, transitional and frameset.


    adivce to mark4man: try reading the error descriptions, and correct what the validator is objecting about. A few things to keep in mind for all XHTML documents:

    - XHTML DTD
    - all tags and attributes lowercase (XHTML and XML are case-sensitive).
    - all attribute values must have quotations around them, name="name".
    - Proper tag nesting, i.e. <i><b>something</b></i>. <i><b>something</i></b> won't work.
    - close all tags. tags without a closing part will need a " /" in the ending, i.e <br />, <img src="" />, etc.
    - all img tags need an "alt" attribute, it can be empty, but have to be there.

    There are more, but I'm tired
    There and Back Again :Ogre:

  6. #5
    Member mark4man's Avatar
    Join Date
    Aug 2003
    Posts
    65
    Member #
    2599
    Thanks, everyone...

    I'll try all that has been advised...

    ...but...

    ...does anyone think it's a good idea to simply convert back to html (& Brak...getting rid of the DTD's in the prologue...that will do it?)

    Thanks,

    mark4man


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:07 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com