Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question DTD & meta Questions

    I looked through a DTD thread and it didn't answer my question and since the thread is closed, I am hoping it is alright that I ask it here.

    I want to know what exactly the point of these are. I know that it has something to do with the browsers being able to display the correct information. But, why can't browsers do that anyway? I realize that things change often, but don't browsers tend to be updated more than code?

    It kind of just boggles my mind that we have to verify which kind of code we are going to use. Which leads me to my question that brought me to this site. What if we want to use various kinds of code. How are we supposed to know which one to use? Dreamweaver defaults to XHTML 1.0 Transitional, but what if I wanted to add frames? Does that mean that I need to use the other doctype resulting in previous code not working correctly?

    Last question I have is what all the stuff means? I've seen the code in the past but never understood it. Was hoping someone could break it down for me. I really want to learn anything I can about web design, but I am kind of a slow learner. Reading a bunch of stock information confuses me and I learn much easier when someone answers a direct question.

    The meta information is something I'd like broken down too.

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    It won't be easy to answer this. Short answer: DTD's were an idea that sounded good at the time, but in reality are rarely used. For this reason, HTML5 doesn't use DTD's.

    Long answer: a DTD is a way of defining a XML language for a computer to read. It states what child content another element may have, the ordering therein, the attributes, etc. However, web browsers have typically ignored DTD's as extra work: in many cases, the web browser knows more about the language than the DTD can convey.

    There are exceptions to this rule. Mozilla Firefox, for example, uses DTD's in its user interface XML files (known as "XUL") for localization of labels into various languages.

    Inline frames, I believe, are part of XHTML 1.0 Transitional, so you should be okay to use that.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • Users who have thanked Alex Vincent for this post:

    Padawan (05-21-2012)

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Alex Vincent View Post
    Inline frames, I believe, are part of XHTML 1.0 Transitional, so you should be okay to use that.
    Of course transitional means that HTML 3.2 tags flagged as obsolete in 1997 are being used in place of their HTML 4 replacements.

    In the case of iframe it was replaced by the <obhect> tag in HTML 4 and all current browsers actually support the use of the object tag properly in place of the proprietary iframe tag. The only browser that needs its own version of the object tag to work is IE6 but hardly anyone uses that any more and if you really need to support it you can nest two object tags and avoid having to use tags made obsolete 15 years ago.


    Also DTDs are actually used for lots of different document definitions. About the only one out of thousands or tens of thousands of different document types where the DTD is ignored is (X)HTML. SGML - the meta language that DTDs are written in predates the creation of the web by many many years and documents based on SGML were used in many different fields long before the web was even thought of.
    Last edited by felgall; 05-10-2012 at 10:33 PM.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    Padawan (05-21-2012)

  • #4
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DTD stands for document type definition,it defines the structure of the document.It defines the legal rule of a document.

  • #5
    New to the CF scene
    Join Date
    May 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I hope the admins don't consider this spam, but I wanted to just thank the first two guys for their help. I wanted to make sure that everyone reading this here knows that I will be planning on using this site from time to time as it seems to be very helpful.

  • #6
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    Quote Originally Posted by felgall View Post
    About the only one out of thousands or tens of thousands of different document types where the DTD is ignored is (X)HTML.
    actually, (X)HTML does not ignore the DTD. as for HTML, the browser just does its best to assume a correct markup from incomplete/invalid code as it’s supposed to be forgiving errors (and thus does not report any errors to the user).
    XHTML on the other hand side does not ignore its DTD at all. the slightest error will cause it to quit parsing (also known as YSoD*). the point where XHTML seems to ignore its DTD is when the document is served as HTML, because the the (forgiving) HTML parser is used. this is typically the case if the Content-Type is left as "text/html" (.htm/.html extension and default Content-Type for all server script extensions). that means to serve XHTML you require either the .xhtml extension and/or the "application/xhtml+xml" Content-Type header.



    * - Yellow Screen of Death
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #7
    New Coder
    Join Date
    May 2012
    Posts
    34
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I am pursuing Java programming language and looking to the thread I thought that it might add something more to my knowledge. My query is what actually is a DTD ? I just need an elaboration as how often is it used in Java programming and what is its use ? Any information will be helpful. Thanks.

  • #8
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    DTD - Document Type Definition (use Google or Wikipedia to find out more)

    AFAIK, a DTD is not used in Java at all (though I’m not a Java expert) same goes for JavaScript. a DTD is used to validate the structure of SGML languages (like HTML or XML).
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #9
    New Coder
    Join Date
    May 2012
    Posts
    34
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Dormilich View Post
    DTD - Document Type Definition (use Google or Wikipedia to find out more)

    AFAIK, a DTD is not used in Java at all (though I’m not a Java expert) same goes for JavaScript. a DTD is used to validate the structure of SGML languages (like HTML or XML).
    Hi Domilich, this is William. Thanks for your concern. Even though you are not a Java expert (as being told by you of course), still then you have provided an accurate information over here. At-least I now know that what are the areas under which DTD can be used. See this is the advantage of asking the doubts over here, a person gets an answer much earlier than that of the search engine.


  •  

    Posting Permissions

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