SitePoint Sponsor

User Tag List

Page 9 of 11 FirstFirst ... 567891011 LastLast
Results 201 to 225 of 265
  1. #201
    SitePoint Enthusiast Sumi's Avatar
    Join Date
    Dec 2005
    Location
    India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I read this post many times and everytime i end up with one doubt ... How would a real XHTML page will look like? I would like to know whether the code below would be a real XHTML page? Or do i need to add some code before or after this?

    Code HTML4Strict:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
    <title>XHTML Page</title>
    </head>
    <body>
    <h1>XHTML Page</h1>
    </body>
    </html>

    The above was to create a page from our side. I did it using Dreamweaver 8.0

    Next thing as I understood from Tommy's explanation was even through we serve MIME as "application/xhtml+xml" from our end, its generally not taken and should be changed at Server as:

    AddType application/xhtml+xml .xhtml .xht -- for Apache

    OR if we don't have access to the configuration files, then we can send http header as (using PHP):

    Code PHP:
    header('Content-Type: application/xhtml+xml; charset=utf-8');

    (and this header must be sent before a single byte of document content is written to the response stream)


    Finally saving this page as ".xhtml" or ".xht" extension only NOT .html/.htm



    Please let me know whether doing a page by following the above method will truly be XHTML. I am not a fan of XHTML though or don't even require it at my work but would like to know about this.


    One more thing, (I don't know much about this XML):
    Does RSS requires a page to be in XHTML/XML? To be clear, If I use RSS/Atom in my page, will my page be in XML or XHTML? (Can HTML handle this?)

    Please explain me
    _____________________________________________
    !!--Sumi-- !!
    Addicted to Web

  2. #202
    SitePoint Enthusiast Sumi's Avatar
    Join Date
    Dec 2005
    Location
    India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One more thing,

    Why does Dreamweaver 8.0 add charset as "charset=iso-8859-1" by default for a XHTML or HTML page, if we should use charset as "charset=utf-8"?
    _____________________________________________
    !!--Sumi-- !!
    Addicted to Web

  3. #203
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumi View Post
    I read this post many times and everytime i end up with one doubt ... How would a real XHTML page will look like?
    Unless you control the presentation with CSS style sheets, that's up to the browser.

    Quote Originally Posted by Sumi View Post
    I would like to know whether the code below would be a real XHTML page?
    The main control mechanism is the Content-Type HTTP header. If your server sends that as application/xhtml+xml, application/xml or text/xml, then the browsers will parse the document as XML. In combination with the correct xmlns attribute in the <html> tag (as in your example), it will be recognised as XHTML.

    Quote Originally Posted by Sumi View Post
    One more thing, (I don't know much about this XML):
    Does RSS requires a page to be in XHTML/XML? To be clear, If I use RSS/Atom in my page, will my page be in XML or XHTML? (Can HTML handle this?)
    RSS is an XML format; it's neither HTML nor XHTML. You can link to an RSS feed from an HTML or XHTML document.
    Birnam wood is come to Dunsinane

  4. #204
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im still learning what goes where is html a version of bb code or are they separate

  5. #205
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML is a standardised markup language specified by the World-Wide Web Consortium (W3C).

    BB code is a specialised way of marking up content in certain forum software.

    They don't have much relation, except that the content you mark up with BB code will eventually be transformed into HTML (since that is what browsers understand).
    Birnam wood is come to Dunsinane

  6. #206
    SitePoint Zealot eLaw's Avatar
    Join Date
    Nov 2008
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi , thank you for these tips ..

    I have a little question , what' is a valid DTD ?

    thanks.

  7. #207
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Birnam wood is come to Dunsinane

  8. #208
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    html has limited tag , but xhtml doesn't have a limited tag.
    we can make the own tag in xhtml.

  9. #209
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by blacksoft123 View Post
    html has limited tag , but xhtml doesn't have a limited tag.
    we can make the own tag in xhtml.
    Yes and no. In XHTML you can use additional namespaces to create whatever element types you want. However, the XHTML namespace itself has a limited set of tags just like HTML.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  10. #210
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by blacksoft123 View Post
    html has limited tag , but xhtml doesn't have a limited tag.
    we can make the own tag in xhtml.
    In theory, yes. In practice, no.

    You can create a custom DTD or use your own namespace. But you can only declare the grammar of the new elements; you cannot describe their meaning. Thus user agents won't know what the new elements mean. You'll need to write browser plug-ins to make sense of your new markup.

    The extensibility of XHTML is an illusion.

    Sure, you can declare elements and attributes with 'semantic' names and define CSS rules to style them. That will look nice in a modern browser, but you'll lose accessibility.
    Birnam wood is come to Dunsinane

  11. #211
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    The extensibility of XHTML is an illusion.
    What about the additional namespaces that are a part of the standards? Presumably browsers that support XHTML should also be expected to support MathML etc.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  12. #212
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    What about the additional namespaces that are a part of the standards?
    What standards? There are no additional namespaces in the XHTML standard.
    Or do you mean W3C recommendations? Like MathML, SVG, etc?

    Quote Originally Posted by felgall View Post
    Presumably browsers that support XHTML should also be expected to support MathML etc.
    Why? There can be any number of specialised namespaces, and a browser can't be expected to support all of them. Things that are deemed to be necessary enough should be incorporated into the core language. Mathematical equations are essential for many scientists, but quite useless for the general population. And if MathML had to be supported, I'm sure accountants, librarians and taxidermists would soon be requesting that their specialised markups were standardised and supported by all browsers.

    Some browsers do support (parts of) MathML and SVG natively. But I doubt they'll be able to keep up if dozens or hundreds of namespaces become W3C recommendations.

    Real extensibility is an illusion, since you cannot convey semantics. For all but the most common extensions you will need plug-ins. That doesn't mean it's useless, only that it targets niche audiences. A markup language semantically rich enough to cater to everyone's needs is virtually impossible, and it doesn't matter if it's one big language or a core with lots of extensions.
    Birnam wood is come to Dunsinane

  13. #213
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    A markup language semantically rich enough to cater to everyone's needs is virtually impossible, and it doesn't matter if it's one big language or a core with lots of extensions.
    I agree. In so far as the core is concerned there isn't much room for improvement over what is already in HTML4.01/XHTML1.0. Anything much beyond that belongs in extensions because as you say it will only be useful for some groups.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  14. #214
    SitePoint Enthusiast Sumi's Avatar
    Join Date
    Dec 2005
    Location
    India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Wordpress generates default XHTML codes. Even if I want to write a page as HTML due to wrodpress generated XHTMLs the code will not validate.

    Any solution for this?

    Thanks!
    _____________________________________________
    !!--Sumi-- !!
    Addicted to Web

  15. #215
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest solution is probably to make sure you use valid XHTML 1.0 markup that complies with the limitations in Appendix C of the specification (thereby being possible to serve as text/html with minimal risk of problems in contemporary user agents). Keep all JavaScript external and make sure all DOM manipulations are done in a way that will work both for XHTML and HTML.

    In other words, keep using pretend-XHTML but be aware of the pitfalls and limitations.

    As I've said before in this thread, there's nothing wrong with using pretend-XHTML if you know what you're doing. There are just no (technical) advantages either.

    I don't know anything about Wordpress, so I don't know if it's possible to convince it to generate honest HTML instead. Someone else may be able to contribute on that.
    Birnam wood is come to Dunsinane

  16. #216
    Non-Member
    Join Date
    Mar 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    In theory, yes. In practice, no.

    You can create a custom DTD or use your own namespace. But you can only declare the grammar of the new elements; you cannot describe their meaning. Thus user agents won't know what the new elements mean. You'll need to write browser plug-ins to make sense of your new markup.

    The extensibility of XHTML is an illusion.

    Sure, you can declare elements and attributes with 'semantic' names and define CSS rules to style them. That will look nice in a modern browser, but you'll lose accessibility.
    The post is informative but also a bit partisan, IMO.
    Sure, why use a feature just only cose' it helps you?
    Just kiddin'.

    I like the idea of being able to add new elements, to add new attributes to existing elements, witch you can't do in html. Is it wrong? Common', in a world of wrong browsers, we're being picky now? Is html perfect? Surely not.

    I see that IE8 now supports XML. It should. And so all the other browsers. It's a good thing. It's growing, even now. It's everywhere, wanted or not. I like JSON better, but we are still too far from getin' a OO Markup Language.

    I like XHTML coze' it helps me? Is it harmful? No more than HTML. No less. It's the child trying to step out of a big fatherly shadow. Let's help him. He'll reward us, I'm sure.

    About namespaces: what if, before html was xhtml. Every browser could have picked their own and we would not have today and had yesterday these compatibility issues to hunt us for years, to drag us back, on and on.

    Html did not save the world, it just opened it. Let's make him better.

  17. #217
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Ulyses View Post
    I see that IE8 now supports XML.
    IE has supported XML for a long time (since IE4 was first released) It is XHTML that IE9 still will not support.

    You will still have to serve XHTML as either HTML or XML and not as XHTML in IE9 in order for it to not just be offered for download.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #218
    Non-Member
    Join Date
    Mar 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    IE has supported XML for a long time (since IE4 was first released) It is XHTML that IE9 still will not support.

    You will still have to serve XHTML as either HTML or XML and not as XHTML in IE9 in order for it to not just be offered for download.
    Let's be clear. We're talking about an extension for a file or a doctype?

    I know that IE supported XML a long time ago (after all, they have XML Islands since IE5, if I'm correct), I've just responded to:
    Will IE7 or IE8 support XHTML?
    No.
    Of course that IE may try to download *.xhtml files, not render them, but it supports XHTML Doctypes, no matter what extension your file may have.

    You can try and put *.avi on a HTML file and you'll see all browsers trying to download it, not rendering it.

    So XHTML Doctype is one thing, and an extension you put on a file does not make it anything (I could change my name to Obama, I would still be the little ant I am ).

  19. #219
    Non-Member
    Join Date
    Mar 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've test it, just to be sure. I've used this test.html file, served by Apache 2.2 httpd.
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 
    <head> 
    	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
    	<title>TEST IE8  - MIME Type</title> 
    </head>
    <body>
    	<h1>IE 8 XHTML MIME Type application/xhtml+xml</h1>
    </body>
    It's rendering perfect on IE 8.0.6001.18702, not trying to download.

    If I'm doing something wrong, or I don't understand something, please point it out. After all, I'm here to learn.

    I've also seen this issue discussed here: http://reference.sitepoint.com/javascript/domcore, saying that:
    However not all browsers support all types, specifically:

    Internet Explorer does not support XHTML (when served correctly as application/xhtml+xml or equivalent) — when documents are served in this way IE will prompt for download, rather than displaying the page. So in this browser it's not possible to conduct tests on this kind of document.
    Right or Wrong?

  20. #220
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,330
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    I don't know anything about Wordpress, so I don't know if it's possible to convince it to generate honest HTML instead. Someone else may be able to contribute on that.
    I use WordPress with HTML 4.01, and it's very easy to set up, as Robert Nyman explains.

    (EDIT: heh heh, small world. Nyman notes that his solution is from code that Tommy himself wrote!)

  21. #221
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Ulyses View Post
    I've test it, just to be sure.
    It's rendering perfect on IE 8.0.6001.18702, not trying to download.

    If I'm doing something wrong, or I don't understand something, please point it out. After all, I'm here to learn.
    You are serving it as HTML and so IE can read it.

    If you served it as XHTML then IE would offer it for download.

    To change from serving it as HTML to serving it as XHTML you need to change the MIME type.

    The MIME type determines what sort of file it is, not the doctype.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  22. #222
    Non-Member
    Join Date
    Mar 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    You are serving it as HTML and so IE can read it.

    If you served it as XHTML then IE would offer it for download.

    To change from serving it as HTML to serving it as XHTML you need to change the MIME type.

    The MIME type determines what sort of file it is, not the doctype.
    I believe I'm serving it as XHTML:

    HTML Code:
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>

  23. #223
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Ulyses View Post
    I believe I'm serving it as XHTML:

    HTML Code:
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
    That tag is too late. The browser needs to know whether it is HTML or XHTML before it reads the first tag in the page content. By the time it reads that tag it is already processing the page content as HTML.

    You need to set it in a header and not in the page content itself to serve it as XHTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  24. #224
    Non-Member
    Join Date
    Mar 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    That tag is too late. The browser needs to know whether it is HTML or XHTML before it reads the first tag in the page content. By the time it reads that tag it is already processing the page content as HTML.

    You need to set it in a header and not in the page content itself to serve it as XHTML.
    I'm a little lost, I admit.

    Would you be so kind as to be more specific, providing an working example maybe.

    Thank you.

    So you're saying, that for testing, I need to make a request, that request be executed back explicitly with a proper header, than linked to the XHTML document, am I right?

    Otherwise, HTTP Servers will all treat *.html files as text/html requests by default, and *.xhtml files as app-xhtml+xml?

  25. #225
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,760
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    You need the server side to do this. You can set the mime type but by then the browser is already rendering the page!@

    If you had taken the time to actually read hte first page of this thread where Tommy goes over this, then you'd know.

    This is taken frrom page 1
    Code:
    You need to instruct your web server to send the proper HTTP header. The exact technique depends on which HTTP server you use, but for Apache, you can use the AddType directive:
    Code:
    AddType application/xhtml+xml .xhtml .xht
    This makes Apache send an application/xhtml+xml MIME type for files ending with .xhtml or .xht. The directive can be put in the global configuration file (/etc/httpd.conf on most *nix systems) or in a local .htaccess file in a directory.
    
    Sometimes we don't have access to the configuration files, but we need not lose hope quite yet. If we can use a server-side scripting language, we can send the HTTP header ourselves. For instance, using PHP:
    
    header('Content-Type: application/xhtml+xml; charset=utf-8'); 
    
    (Note that this header must be sent before a single byte of document content is written to the response stream.)
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •