xHTML & ASP.NET

Discussion in 'Web Development & Web Hosting' started by ThomasMc, Aug 30, 2007.

  1. ThomasMc

    ThomasMc Gigabyte Poster

    1,507
    49
    111
    Hey everyone just a quick question, whats the best way to get an ASP.NET app to conform to the xHTML standard. So far i have been doing it manually bit by bit, but is there a way i could maybe do it automatically on the fly (i.e. when the page loads) my exprience isn't all that indepth and are using vb. Any help or suggestions would be more than welcomed.

    Thanks
     
    Certifications: MCDST|FtOCC
    WIP: MCSA(70-270|70-290|70-291)
  2. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    You could try a product called tidy.

    As I've said before on these forums, XHTML is a data standard, its pretty irrelevant in reality to most browsers, so i wouldn't really place that much value on what you are trying to achieve.
     
  3. Stoney

    Stoney Megabyte Poster

    731
    23
    69
    Unless you actually want your web page to work correctly and in different types of browsers!!

    The whole point of xhtml is to create a standard for the structure of web pages, and to remove the hap-hazard formatting that occurs across web browsers, because most web designers think it's a good idea to lay everything out in a web page using tables!

    If you are serious about web design then you should be working to the standards set out by W3C which means using xhtml.

    As for your question ThomasMC, I guess if you're writing code in asp.net that creates a web page using xhtml, you should allow that page to be created in a test environment and then validate the xhtml.

    W3schools have an xhtml validator here.

    You just need to enter the URL of the web page and it will validate the xhtml for you.

    You can also try using the Web developer plugin for firefox that will also validate xhtml. Firefox is built to use web standards and if your page works ok in Firefox, then it's a good indicator that it conforms to web standards.

    HTH
     
    Certifications: 25 + 50 metre front crawl
    WIP: MCSA - Exam 70-270
  4. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    Browsers render and parse HTML do they not ?

    http://hsivonen.iki.fi/doctype/

    Therefore without the correct MIME type which many people omit, you've actually achieved NOTHING !

    Another problem is which version of XHTML are you actually supporting ?

    XHTML 1.0
    XHTML 1.1 or
    XHTML 2.0

    Note even version 1.0 has three doctypes, and they are still working on version 2 !


    While this may be the desire of various initiatives, this is largey a 'coding standard' you can have valid XHTML and still have table based layout. This is an accessibility goal and is not really related to HTML vs XHTML. Also to my knowledge hap hazard rendering occurs for virtually all standards on all browsers, its just a matter of degree.


    Well I think HTML is still valid for web design :biggrin.
    Also not all standards are good standards, when you've been around as long as me you'll learn the wisdom ;)

    HTML is a web standard, why not conform to that ?

    See :-

    http://www.alistapart.com/articles/xhtml/
    setting the right doctype.
    http://htmlhelp.com/tools/validator/doctype.html


    Just because someone tells you XHtML is the newest shiniest thing and we should all use it doesn't make them right ! :D
    Developers have a responsibility to use technology responsibly, this means not telling your boss to throw out their old code every 10 minutes !

    The biggest benefit of XHTML to me is that you can use a standard generic XML parser to parse it, now this is pretty irrelevant to browser vendors who write their own low level parsers and also support HTML etc.
    However I will leave you to think about where this becomes useful...
     
  5. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    If you are really bothered you could write your own rendering layer to replace the ASP .Net rendering layer.

    http://www.ddj.com/windows/201202758

    Like I said its likely this is a huge waste of time however ! Especially as the .Net rendering will change over time, and may well become more XHTML compliant anyway :biggrin
     
  6. ThomasMc

    ThomasMc Gigabyte Poster

    1,507
    49
    111
    Thanks dmarsh Kudos added, maybe i picked up the whole xhtml thing up wrong, wasn't it brought in with new technologies in mind i.e mobilephone, pda and other new gizmos to standardize data between the diffrent agents?
     
    Certifications: MCDST|FtOCC
    WIP: MCSA(70-270|70-290|70-291)
  7. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    See these :-

    http://www.robertnyman.com/2005/06/17/how-to-generate-valid-xhtml-with-net/
    http://www.robertnyman.com/2005/04/04/why-xhtml/
    http://friendlybit.com/html/why-xhtml-is-a-bad-idea/
    http://en.wikipedia.org/wiki/XHTML

    I'm not entirely sure why they created XHTML, and in fact XHTML 2.0 is not backward compatible so it looks like they aren't sure either ! :biggrin

    A lot of the goals seem laudable in themselves, easier to write parsers, well formed source etc, its just all these are technical problems that the general public couldn't care less about,
    they already have effective HTML parsers and renderers, why are they going to move ? All the time there are two standards theres little real benefit to the people XHTML was designed to help
    as they now need to be aware of two standards !

    If you need to process HTML with an XML parser then you need XHTML end of.

    As for everything else I'd say its up for grabs, most handhelds have HTML browsers.
     

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.