How can I fix wrong html codes in over 400 pages?

Discussion in 'HTML & Website Design' started by comedy1, Feb 26, 2009.

  1. #1
    Hi,

    I need help about fixing html codes. There are over 400 pages in my site. And there are many html code mistakes. When I check in w3.org the system finds Result: 656 Errors, 191 warnings in my site. But it's so confusing for me. I don't know how to fix this. Could any one help me about this?

    Thanks.
     
    comedy1, Feb 26, 2009 IP
  2. theivo

    theivo Well-Known Member

    Messages:
    238
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #2
    You can start with the function > Find and Replace in Dreamweaver. There's possibility to search in source code and to replace the most common errors found by you. This is a big timesaver.
     
    theivo, Feb 26, 2009 IP
  3. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are they all static pages or in a cms ?
    It would be quite easy to fix the problems in a cms .
    Using replacement(dreamweaver or any other html page editor) if they are static pages .
     
    justinlorder, Feb 26, 2009 IP
  4. comedy1

    comedy1 Active Member

    Messages:
    150
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #4
    comedy1, Feb 26, 2009 IP
  5. aloksharma

    aloksharma Well-Known Member

    Messages:
    1,058
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Just tick the "Clean up Markup with HTML Tidy" check box and click Validate or Revalidate button. Now copy and paste the html code in your file and save it. But I am afraid that you will have to do it for each and every file.

    Apart from than that, in Dreamweaver, go to Edit > Preferences > Code Rewriting and tick "Fix individually nested and unclosed tags", "Remove extra closing tags" and "Warn when fixing or removing tags" check boxes. Now when you open the file, its will automatically fix most of the issues for you. Again, you will have to repeat this for all the files you want to fix.

    Hope that helps you friend.
     
    aloksharma, Feb 26, 2009 IP
  6. effektz

    effektz Active Member

    Messages:
    474
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #6
    This is why you should use template files. You could write a script that goes through each file and replaces the text you need fixed.
     
    effektz, Feb 26, 2009 IP
  7. aloksharma

    aloksharma Well-Known Member

    Messages:
    1,058
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    160
    #7
    You are right. May be he should use some CMS which can build static or dynamic pages.
     
    aloksharma, Feb 26, 2009 IP
  8. km11kh

    km11kh Banned

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    this is right way to fix all errors but first check what code you have replace to fix this problem..
     
    km11kh, Feb 28, 2009 IP
  9. ferrero

    ferrero Well-Known Member

    Messages:
    136
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #9
    The errors that you are seeing depends on what standards validation you are using, html 4.01, xhtml, strict or transitional.

    If the errors are consistent in all your pages then just like it has been mentioned before, use the 'edit > find and replace' tool in Dreamweaver. If the pages are XHTML then use the 'command > clean up xhtml.
     
    ferrero, Feb 28, 2009 IP
  10. ClassHelper.org

    ClassHelper.org Guest

    Messages:
    273
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I wrote an article that covers exactly this sort of problem; you can find it here: XHTML Website Conversion. It's most useful to people whose sites are hosted on Linux or BSD with a shell login, but the principles apply to locally developed content as well.

    A Perl script is included in the article that may be of use. I hope this helps!
     
    ClassHelper.org, Feb 28, 2009 IP