SitePoint Sponsor |
|
User Tag List
Results 26 to 43 of 43
-
Jun 3, 2009, 12:05 #26
- 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
-
Jun 3, 2009, 14:29 #27
I have determined that it is preferred to have it well formed and valid as well.
understood...
Thank you guys
-
Jun 4, 2009, 03:05 #28
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
The XML spec says that the parser will abort.
This cannot happen by definition.Simon Pieters
-
Jun 4, 2009, 20:34 #29
- Join Date
- Feb 2007
- Posts
- 270
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 5, 2009, 00:35 #30
- Join Date
- Jul 2008
- Location
- New York, NY
- Posts
- 1,432
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 5, 2009, 01:57 #31
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 5, 2009, 09:07 #32
- 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.
-
Jun 5, 2009, 09:33 #33
- Join Date
- Feb 2007
- Posts
- 270
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Jun 5, 2009, 09:48 #34
- Join Date
- Jul 2008
- Location
- New York, NY
- Posts
- 1,432
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 5, 2009, 10:20 #35
- 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.
-
Jun 5, 2009, 12:22 #36
- Join Date
- Feb 2007
- Posts
- 270
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Jun 6, 2009, 02:02 #37
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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 )
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-nwfSimon Pieters
-
Jun 6, 2009, 11:14 #38
- 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.
-
Jun 6, 2009, 14:06 #39
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 6, 2009, 19:47 #40
- 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.
I have yet to see documentation stating that I am incorrect in my belief.
-
Jun 7, 2009, 02:23 #41
- 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 thatOriginally Posted by RFC 2854
(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
-
Jun 7, 2009, 02:28 #42
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 7, 2009, 11:48 #43
- 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."?
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?
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