SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 43 of 43
  1. #26
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    If an element is well formed AND valid it won't have any weird effects, just whatever you code on itt.

    If you have a well formed element and it ISN'T valid, there is no telling what will happen-with invalid code you can't expect valid results

    If you have a non well formed element and ISN'T valid you are just asking for trouble. No telling what will happen.

    If you have a non well formed element and IS valid still no tellinng what will happen.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  2. #27
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have determined that it is preferred to have it well formed and valid as well.

    understood...

    Thank you guys

  3. #28
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    If you have a well formed element and it ISN'T valid, there is no telling what will happen-with invalid code you can't expect valid results
    It depends on whether the spec defines what should happen or not. XHTML 1.0 does not say what should happen, while e.g. SVG 1.2 and XHTML5 do say what should happen.

    Quote Originally Posted by RyanReese View Post
    If you have a non well formed element and ISN'T valid you are just asking for trouble. No telling what will happen.
    The XML spec says that the parser will abort.

    Quote Originally Posted by RyanReese View Post
    If you have a non well formed element and IS valid still no tellinng what will happen.
    This cannot happen by definition.
    Simon Pieters

  4. #29
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Wrapping an anchor around a block level element in xhtml doesn't validate. It might be well formed in html5
    Just a slight correction. "Well formed" is an XML concept; you could apply it to XHTML5 but not HTML5. HTML5 speaks of "conformance," so well-formedness from XML would be conformity, so possibly "conformal" would be the equivalent term for "well formed."

  5. #30
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arlen View Post
    Just a slight correction. "Well formed" is an XML concept; you could apply it to XHTML5 but not HTML5.
    So you're saying you can only consider things well-formed in xhtml and not html?

  6. #31
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arlen View Post
    Just a slight correction. "Well formed" is an XML concept; you could apply it to XHTML5 but not HTML5.
    Yup.

    Quote Originally Posted by Arlen View Post
    HTML5 speaks of "conformance," so well-formedness from XML would be conformity, so possibly "conformal" would be the equivalent term for "well formed."
    Conformance is a superset. The equivalent of well-formed for text/html would probably be "without parse errors".

    Quote Originally Posted by cooper.semantics View Post
    So you're saying you can only consider things well-formed in xhtml and not html?
    Correct.
    Simon Pieters

  7. #32
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The W3C DOM Core module defines how to access, read and manipulate an XML document. Well-formed HTML documents are XML documents, so these methods and properties can be used to completely rewrite any HTML page, if you so wish.
    Though HTML documents are XML documents, they have a number of special features that the average XML document doesn't have. The W3C DOM HTML module defines these special cases and how to deal with them.
    http://www.quirksmode.org/dom/contents.html

  8. #33
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    So you're saying you can only consider things well-formed in xhtml and not html?
    Weeeellll......

    OK. I didn't intend to start a trivia discussion, but that's a fair question.

    You can *talk* about well-formed in HTML2-4, but not in 1 or 5, and in all versions of XHTML. Why?

    Because I oversimplified things just a bit, partly because I didn't want to bog things down with discussions of things other than the difference between HTML5/XHTML5, but I see now that was a mistake on my part.

    I said "well-formedness was an XML concept," when, if I were to be absolutely and universally precise I should have said, "well-formedness is a concept XML inherited from SGML." Since there was a wholehearted attempt to make HTML a subset of SGML in versions 2-4, you *can* apply those concepts to those versions of HTML in a futile way (futile, because no browser depended upon well-formed HTML).

    The point I was specifically referring to mentioned it in an HTML5 context, which was why I answered the way I did, that because XML had the concept of well-formedness, XHTML5 could be that, but HTML5 itself had no concept of well-formedness, only of conformance, so the term shouldn't be used there.

    But I think your PPK quotes are out of context. Specifically the second: Peter-Paul Koch most assuredly knows that not all HTML documents are XML documents. I think the context for that quote assumes "well-formed" instead of plain HTML.

  9. #34
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arlen View Post
    I think the context for that quote assumes "well-formed" instead of plain HTML.
    Of course

  10. #35
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.webreference.com/dlab/books/html/38-2.html

    In fact, the preceding requirements are the only ones that you must satisfy to make your HTML files well-formed XML. It doesn't matter which browser's HTML extensions you use or whether you "abuse" HTML tags or not. XML is a truly liberal language; it makes you a creator of your own universe whose rules you're unlikely to break simply because it's you who establishes them.
    What do you think Arlen?

  11. #36
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    I think because you want to use the term doesn't mean you should.

    That page doesn't contradict a single word I wrote. It speaks of well-formedness as an xml concept and applies it to an older version of HTML. In short, it says the same thing I said.

    If you want to extend the practice to HTML5, then you're simply writing "bilingual" XHTML5 (sorry I'm blanking on the official term for it, but I'm after the flavor of HTML5 that can be served with either xml or html mime types). Well-formed still doesn't apply to vanilla HTML5.

  12. #37
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    quirksmode.org isn't authoritative, either, sorry.

    Even if it is a widely spread misconception that well-formedness is a concept that can be applied to HTML or SGML, it is not technically correct. The SGML and HTML specs do not define such a concept. (Try searching for "well-formed" in http://www.w3.org/TR/html4/html40.txt )

    Quote Originally Posted by Arlen View Post
    I said "well-formedness was an XML concept," when, if I were to be absolutely and universally precise I should have said, "well-formedness is a concept XML inherited from SGML."
    No. It's a concept that XML invented. (It was invented in order to support DTDless parsing.)

    In SGML, a document instance is either valid (according to its DTD and SGML declaration), or it is not.

    As I said earlier, there is the concept of "well-formed XML documents", defined here:
    http://www.w3.org/TR/REC-xml/#sec-well-formed

    ...and "well-formed parsed entity", defined here:
    http://www.w3.org/TR/REC-xml/#wf-entities

    To confuse things more, there's also the concept of namespace-well-formed documents, which is defined in the Namespaces in XML spec.
    http://www.w3.org/TR/REC-xml-names/#dt-nwf
    Simon Pieters

  13. #38
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @zcorpan

    I am one of those believers that believes well-formed html is xml.

    The references I posted I am in agreeance with.

    If you can provide a statement from the w3c that says "well-formed html isn't xml", or something similiar to that, then I will change my mind.

  14. #39
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    @zcorpan

    I am one of those believers that believes well-formed html is xml.
    What do you mean with "well-formed html"?

    Do you mean something along the lines of "If I take this HTML document, interpret it as XML, and it's well-formed, then I'll say that it's XML."?

    Do you similarly believe that "well-formed plain text" is XML?

    Would your belief be reflected in whether you would parse content labeled as HTML with an XML parser if you were to write software that consumes XML?
    Simon Pieters

  15. #40
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A well-formed document conforms to the XML syntax rules; e.g. if a start-tag (< >) appears without a corresponding end-tag (</>), it is not well-formed. A document not well-formed is not in XML; a conforming parser is disallowed from processing it.
    Also, I have validated some of my xhtml served as text/html(which is html) in a xml validator and it passed.

    I have yet to see documentation stating that I am incorrect in my belief.

  16. #41
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't say you were incorrect in your belief, I was just asking a few questions. They were not rhetorical, by the way; I'm still curious.

    I agree that the XML spec says that any stream of bytes that matches the syntax for XML is XML, even if that stream of bytes is labeled as being something else. This is because the XML spec does not discuss the transport layer at all.

    The requirements of the HTTP transport layer are given in RFC 3023 which says which content you should treat as XML. text/html is not part of it. The RFC for text/html says that
    Quote Originally Posted by RFC 2854
    Implementors of text/html interpreters must be prepared to be "bug-compatible" with popular browsers in order to work with many HTML documents available the Internet.
    (See -- it says you should be bug-compatible! It doesn't even say you should use an SGML parser for text/html.)

    (RFC 2854 will probably be obsoleted by a new RFC that makes this statement clearer by saying something like "Implementors of text/html interpreters must follow the HTML5 parsing rules.".)
    Simon Pieters

  17. #42
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cooper.semantics View Post
    Also, I have validated some of my xhtml served as text/html(which is html) in a xml validator and it passed.
    This is because the xml validator you used does not comply to the RFCs mentioned above.

    http://validator.nu/ does comply but has a checkbox to make it non-compliant.
    Simon Pieters

  18. #43
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @zcorpan

    I am basing this on XML Syntax...
    The loose state of HTML documents is responsible for the great emphasis W3C puts on making sure XML documents are well-formed.

    Do you mean something along the lines of "If I take this HTML document, interpret it as XML, and it's well-formed, then I'll say that it's XML."?
    Yep
    Do you similarly believe that "well-formed plain text" is XML?
    XML data is stored in plain text format. Well formed plain text can be converted to a specialized XML format.
    Would your belief be reflected in whether you would parse content labeled as HTML with an XML parser if you were to write software that consumes XML?
    Not basing this on parsing....
    HTML is parsed differently and the rules are different for error recovery but HTML is following a more friendly set of rules with room for error.

    This URI is not proving anything I am saying, but could be of some interest to you
    http://www.w3.org/TR/1998/WD-html-in-xml-19981205/


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
  •