SitePoint Sponsor

User Tag List

Page 3 of 9 FirstFirst 1234567 ... LastLast
Results 51 to 75 of 215
  1. #51
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    The XML declaration goes first.
    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.

  2. #52
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BluDragon
    Take a look-see:
    That's not sending any xml headers before displaying though, so it's trying to render as html.

  3. #53
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The XML declaration must come first. But beware of using that indiscriminately if you're serving your pages as text/html. Anything, including an XML declaration, before the doctype declaration will make IE6/Win render the page in quirks mode.
    Birnam wood is come to Dunsinane

  4. #54
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    K.S.A
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have this in my so-called xhtml files:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    first I didn't have the <?xml and I didn't send the content-type header ..
    but after using:
    PHP Code:
    header("Content-type: application/xhtml+xml"); 
    and putting the xml delceration, FireFox complained about that <?xml not being in the first line.. so after changing everything FireFox displayed the page correctly..
    and looking at the page info I found that the type is application/xhtml+xml..
    I was happy

    but knowing that IE wont parse it, I tried opening the same page with IE but it seems to render correctly!!
    am I doing something wrong!?

    edit: seems like it was a cache problem.. now any link I try to open with IE in that page will actually try to download..
    Last edited by NeverMind; Apr 11, 2005 at 14:31.

  5. #55
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay. I changed the first lines of code on a static page to read:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

    When I checked the header, it still tells me the content type is text/html. So the mime type must be the issue. I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?

  6. #56
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,271
    Mentioned
    252 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Tech Evangelist
    Okay. I changed the first lines of code on a static page to read:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

    When I checked the header, it still tells me the content type is text/html. So the mime type must be the issue. I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?
    I am not a huge expert, but I am quite sure that someone here will correct me if I am wrong.

    Yes, you can change the mime type with the .htaccess file.

    As far as my understanding goes, XHTML and XML applications do not render properly in browsers as these do not have full support for it (if any at all). Most of the XML applications that work do it because is it the web server that does the parsing, and not the browser. I think that Amazon Web Services works this way.

  7. #57
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?
    If it isn't already configured this way, you can change it with .htaccess:
    Code:
    AddType application/xhtml+xml xhtml xht
    Then use "xhtml" or "xht" as file extension.
    Simon Pieters

  8. #58
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tech Evangelist
    Okay. I changed the first lines of code on a static page to read:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

    When I checked the header, it still tells me the content type is text/html. So the mime type must be the issue. I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?
    I just noticed that too - that explains why my page parses fine in IE.

  9. #59
    SitePoint Zealot LSW's Avatar
    Join Date
    Jul 2004
    Location
    Juneau Alaska
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tommy, question for clarification:

    Quote Originally Posted by AutisticCuckoo
    This is pointless. You cannot change the content type through a META element, because the user agent needs to know it before it starts parsing. It must go in a real HTTP header. As zcorpan said, you can't change the character encoding this way, either. For X(HT)ML, that should be declared in the XML declaration:
    So I know with XHTML I can drop the Charset meta tag for the language as it goes with the header etc.

    So same for HTML? Is that meta tag required for HTML or is it jst extra baggage. I have it in all my web pages that are not XHTML, but do not remember if it was something I was taught to use or just becauseall editors add it automatically, it has always simply been there.

    So can we drop it from HTML as well as XHTML?
    Thank You, Migwetth, Gunalche’esh, Ha’w'aa, Danke

    Kyle Lamson



  10. #60
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't say for sure. The main reason for having the META element with a Content-Type equivalent is when you're saving the document to disk and opening it locally. Then there is no HTTP header being sent, and the META element can be useful, especially if you're using an odd character encoding.

    This information should be sent from the web server, so there is no real need to have the META element.
    Birnam wood is come to Dunsinane

  11. #61
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LSW
    Tommy, question for clarification:


    So I know with XHTML I can drop the Charset meta tag for the language as it goes with the header etc.

    So same for HTML? Is that meta tag required for HTML or is it jst extra baggage. I have it in all my web pages that are not XHTML, but do not remember if it was something I was taught to use or just becauseall editors add it automatically, it has always simply been there.

    So can we drop it from HTML as well as XHTML?
    Yes.

    Like with XHTML, and HTML user agent will check the character encoding specified by the HTTP Response header first. The user agent will only refer to a character encoding specified in a <meta> element if the character encoding was not specified in the HTTP response header.

    It is safe, however, to leave the <meta> element in your document, if it contains correct information. It will simply be ignored when the character encoding is specified in the HTTP header. There isn't any significant reason why you should remove it.

    You do need to specify the character encoding somewhere, however. You can't omit it completely. HTML user agents cannot assume any default character encoding - due to server limitations. This is why the <meta> element method is recommended when it is not possible to send the character encoding in the HTTP header.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog · Twitter · Contact me
    Neon Javascript Framework · Jokes · Android stuff

  12. #62
    SitePoint Zealot LSW's Avatar
    Join Date
    Jul 2004
    Location
    Juneau Alaska
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks!
    Thank You, Migwetth, Gunalche’esh, Ha’w'aa, Danke

    Kyle Lamson



  13. #63
    SitePoint Addict dannyh's Avatar
    Join Date
    Mar 2005
    Location
    BC, Canada
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    ... By contrast, XHTML is not in such widespread use and is not well supported by browsers yet. For example, Microsoft's Internet Explorer does not have any support for XHTML at all and treats all XHTML as if it is HTML 4.01.

    What exactly is not supported? I know it treats it as HTML, I understand that much. But XHTML and HTML 4.01 have the same syntax except for self-closing tags.

    Does XHTML 1.0 actually have anything else which HTML 4.01 doesnt, but is not yet supported?

    If it doesnt, then what in gawds name was the point of creating another language that gets parsed as XML instead by SGML ?

    I feel like Im missing something here. Is there a whole world of cool XHTML tags that arnt yet supported, and I have not seen or ead about?

    They arnt supported today, so I will serve them as HTML 4.01 but hell! I want to at least LEARN the new language so when it IS supported I will know what Im doing.

    I been reading on some of the links posted in this thread and certain people refer to "real XHTML". What is "real" XHTML then other then HTML with self closing tags and a different doctype ?

    I really just want to learn waht the differences are of "real" XHTML and HTML 4.01 because I find it interesting. Does anyone have any links for this? Are they actually the exact same?

    I thought I had all this HTML/XHTML hooplah under control but now Im confused.... why cant we all just get along

  14. #64
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's true that there aren't many differences between HTML 4.01 and XHTML 1.0, however the differences that there are are quite significant.

    real XHTML is XHTML served as XML, not as HTML.

    XML is a simpler derivation of SGML, thus you can make smaller programs to handle XML and real XHTML documents.

    Another point of XHTML is that it enables you to have HTML and XML elements in the same document.
    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.

  15. #65
    SitePoint Addict dannyh's Avatar
    Join Date
    Mar 2005
    Location
    BC, Canada
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when "real" xhtml is served as such (application/xhtml+xml or whatever the correct syntax is exactly) what advantages does that give? How does the client and/or user benifit?

  16. #66
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dannyh
    Does XHTML 1.0 actually have anything else which HTML 4.01 doesnt, but is not yet supported?
    Yes, there are some things supported in XHTML which are not support in HTML. The following only works in XHTML:
    Code:
    <script type="text/javascript">
    <!-- This is a script I wrote today -->
    <![CDATA[
    
    alert('Hello World');
    
    ]]>
    </script>
    what in gawds name was the point of creating another language that gets parsed as XML instead by SGML ?
    XML is significantly easier to parse. Also, it is more clearly specified in the XML spec what should happen when a document is not well-formed - the parser should halt and return an error. This will enforce well-formed code, one of the strongest arguments for using XML for XHTML, for example.

    I feel like Im missing something here. Is there a whole world of cool XHTML tags that arnt yet supported, and I have not seen or ead about?
    Yes - versions of XHTML after XHTML 1.0 include cool features that you have not seen or read about. XHTML 1.0 is just a reformulation of HTML 4.01 in XML which is intended to ease the transition, so it does not include any new or cool features other than those specific to XML. XHTML 1.1 does not include any significant new features for end users, but it makes it easier to define new languages based on XHTML. XHTML 2.0 will include lots of new and very cool features.

    They arnt supported today, so I will serve them as HTML 4.01 but hell! I want to at least LEARN the new language so when it IS supported I will know what Im doing.
    You can, if you want, use XHTML 1.0, XHTML 1.1, XHTML Basic, XHTML+MathML and so on with browsers such as Firefox and Opera for testing. IE is the only major browser not to support XHTML. So you can play with XHTML in these browsers as much as you like, so that when it is more widely supported then you will know what you are doing.

    I been reading on some of the links posted in this thread and certain people refer to "real XHTML". What is "real" XHTML then other then HTML with self closing tags and a different doctype ?
    "Real" XHTML refers to XHTML that is processed by a browser as XHTML. XHTML 1.0 (and only XHTML 1.0) allows for it to be served to some browsers as HTML, with some additional conditions imposed.

    I really just want to learn waht the differences are of "real" XHTML and HTML 4.01 because I find it interesting. Does anyone have any links for this? Are they actually the exact same?
    The most concise and accurate source of information about this is the XHTML 1.0 recommendation itself:
    http://www.w3.org/TR/xhtml1/

    It's a pretty short document, so it won't take long to read. But if you want to skip to the good bits, read section 5.1 and then Appendix C.

    I thought I had all this HTML/XHTML hooplah under control but now Im confused.... why cant we all just get along
    It's understandable that you are confused, and that you want more information.

    This page debunks many myths about XHTML:
    http://hsivonen.iki.fi/wannabe/

    This page claims that interpreting XHTML as HTML is bad. But it is a bit of a rant, so don't get too disheartened:
    http://www.hixie.ch/advocacy/xhtml
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog · Twitter · Contact me
    Neon Javascript Framework · Jokes · Android stuff

  17. #67
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dannyh
    when "real" xhtml is served as such (application/xhtml+xml or whatever the correct syntax is exactly) what advantages does that give? How does the client and/or user benifit?
    - It is processed as XML rather than SGML. XML is easier to parse than SGML, and most XML processors are fully conforming. XML specifies what should happen when a well-formedness error occurs, whereas in SGML the result is unpredictable. This enforces well-formed code.

    - XHTML can be combined with other languages in an XML document, by using multiple namespaces in the document. For instance, an XHTML+MathML document consists of both XHTML and MathML in the same document. This is impractical with SGML.

    - Future versions of XHTML after XHTML 1.0 will not be compatible with HTML.

    - XHTML can be processed by XML processors such as XSLT.

    Those are some of the advantages. However, there are disadvantages too. One big disadvantage is the lack of support for XHTML in IE. Another is that legacy code, particularly a lot of JavaScript, will cease to work and fixing it will be difficult. In the latter case, you really should be using HTML 4.01.

    Quote Originally Posted by Kravvitz
    Another point of XHTML is that it enables you to have HTML and XML elements in the same document.
    I assume you meant to say "it enables you to have XHTML and XML elements in the same document". XHTML elements are XML elements, therefore that would be technically correct.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog · Twitter · Contact me
    Neon Javascript Framework · Jokes · Android stuff

  18. #68
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From the point of view that, XHTML is XML-ized HTML, I meant what I said.

    XHTML is just a standardized list of XML elements and attributes that happens to look a lot like HTML, right?
    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.

  19. #69
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Real XHTML, which IE does not support, allows style sheets to be specified through PIs (processing instructions) instead of LINK elements:
    HTML Code:
    <?xml-stylesheet type="text/css" href="/default.css" media="screen"?>
    <?xml-stylesheet type="text/css" href="/special.css" media="screen" alternate="yes"?>
    In real XHTML, you can use self-closing tags for any empty element, not only those element types that are declared as #EMPTY in the DTD. For instance:
    HTML Code:
    <script type="text/javascript" src="foo.js"/>
    Birnam wood is come to Dunsinane

  20. #70
    SitePoint Addict dannyh's Avatar
    Join Date
    Mar 2005
    Location
    BC, Canada
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    Yes, there are some things supported in XHTML which are not support in HTML. The following only works in XHTML:
    Code:
    <script type="text/javascript">
    <!-- This is a script I wrote today -->
    <![CDATA[
    
    alert('Hello World');
    
    ]]>
    </script>
    ...

    XHTML 1.1 does not include any significant new features for end users, but it makes it easier to define new languages based on XHTML. XHTML 2.0 will include lots of new and very cool features.

    ....

    You can, if you want, use XHTML 1.0, XHTML 1.1, XHTML Basic, XHTML+MathML and so on with browsers such as Firefox and Opera for testing. IE is the only major browser not to support XHTML. So you can play with XHTML in these browsers as much as you like, so that when it is more widely supported then you will know what you are doing.
    Where can I learn about defining new languages based on XHTML? Right now, If I setup some XHTML documents on my personal server, being served as XML I would not know what to do with them other then render the common looking/acting webpage. I dont know where to start... or what to ask for to know where to start.

    Do I just need to learn plain old XML first then I will know what to do and I can write my own tags (Im assuming thats what it means by defining your own language) in the DTD ?

    Right now at this current moment, does XHTML 1.1 have any addition tags that HTML 4.01 does not? If not, is it possible to create your own after reading up on the subject by creating your own DTD's?

    Since XHTML is essentialy a more specific version of XML, if I versed myself on the XML language would I be able to 'play' with XHTML without learning additional material, or are they still seperated so I wouldnt neccessarily know what Im doing still?

    The clouds are starting to clear a little for me on all this XHTML vs HTML stuff, especially when you throw in all the different versions of XHTML alone into the party.

  21. #71
    SitePoint Addict dannyh's Avatar
    Join Date
    Mar 2005
    Location
    BC, Canada
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh, and what about XSLT vs CSS?

    Are either inferior, and will XHTML have a future with CSS or will it have its own stylsheet system (XSLT or otherwise) ?

  22. #72
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The 2 will coexist, since one is used to markup html/xhtml and the other one is to style it all

  23. #73
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    XSLT is generally used to transform markup and as for XHTML eXtensibilty that can be done via the DTD like I have done in the past. Also remember HTML will be predominantly used on most new websites for another decade whether we like it or not.


    However, bear in mind all those browsers than don't understand "application/xhtml+xml" are less likely to be able to cope with the results of a modified XHTML DTD.

  24. #74
    SitePoint Addict dannyh's Avatar
    Join Date
    Mar 2005
    Location
    BC, Canada
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is strictly for testing xhtmlcoder... I just want to experiment

  25. #75
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dannyh
    oh, and what about XSLT vs CSS?

    Are either inferior, and will XHTML have a future with CSS or will it have its own stylsheet system (XSLT or otherwise) ?
    XSLT is not a stylesheet language, it is a transform language. That means it serves a different purpose.

    XSL-FO, however, is a stylesheet language. For a very vague and rough description of it, imagine CSS reformatted as XML. It's not time to throw out your CSS books though, as CSS is still a W3C recommendation and is still being developed (CSS3 is on the way).
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog · Twitter · Contact me
    Neon Javascript Framework · Jokes · Android stuff


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
  •