11-08-2019, 07:24 PM | #1 |
Member
Posts: 21
Karma: 10
Join Date: Jun 2012
Device: Samsung Note20 Ultra, Kindle Fire HD10
|
Is there any value to XHTML vs HTML?
Hello there, everybody. I've occasionally looked to these forums for my SIGIL and CALIBRE information searches, and been impressed each time.
As many Sigil users know, they dropped the BookView feature in it. Fortunately, for those of us who liked to see the WYSIWYG aspect, we know have PageEdit to help ourselves out. My question is: The description of PageEdit says it is an "ePub XHTML Visual Editor". Granted, I've used PageEdit with purely HTML ebooks. In fact, when I edit my EPUBs, I tend to change all text files to either HTML or CSS. If I see an XHTML, I generally rename it to HTML. As such, I'm wondering whether (with respect to ebooks only) what value do XHTML files have over HTML files? Is there something I can do in an ebook with XHTML that I can't with HTML? I can easily image that for a website, XHTML might have some pretty nifty features. But for an ebook, is there *ANY* feature that XHTML has that can benefit me in an ebook? If it helps, I (almost) exclusively use Sigil to compile and edit FanFiction stories (from websites like fanfiction_net) into a final, more pleasing aspect. Like many of you, I like having my ebooks as perfect and proper as possible. Thus, is there any reason (for ebooks) to use XHTML? Or am I safe in making all my XHTML files into HTML and reading my ebooks in that way? Thanks for any comments. Frank P.S. Is EPUB 2.0 good enough for the long haul, or will EPUB 3.0 have features that become a dealbreaker? Specifically, it seems that all the ebook readers are quite content to stay at EPUB 2.0 compatibility and EPUB editors seem to not dissuade users from creating EPUB 2.0 documents. |
11-08-2019, 10:44 PM | #2 | ||||
Grand Sorcerer
Posts: 27,597
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
Quote:
Quote:
Last edited by DiapDealer; 11-08-2019 at 11:01 PM. |
||||
Advert | |
|
11-09-2019, 08:37 AM | #3 | |
A Hairy Wizard
Posts: 3,119
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
It is HIGHLY recommended to learn the very basic html/css required for making a good book. That way you can work in the Code view pane and see exactly what it will look like in the Preview Pane at the same time. Cheers, |
|
11-10-2019, 01:50 AM | #4 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
XHTML + XHTML5 are what the EPUB specs require.
There are a few (more technical) differences between HTML + XHTML, but the only real surface level thing is that XHTML is more strict. Here are a few examples: 1. If you have an open tag, XHTML requires you have a closing tag. So something messy like this is "valid" (but poor) HTML: Code:
<p>This is paragraph 1. <p>This is paragraph 2. Code:
<p>This is paragraph 1.</p> <p>This is paragraph 2.</p> Code:
<p><b>This is bold.</p></b> Code:
<p><b>This is bold.</b></p> Code:
<br> <img src="example.jpg"> Code:
<br /> <img src="example.jpg" /> Quote:
So if you put in poorly formed HTML, it will all be nested properly + cleaned up to the best of Sigil's ability. Paste those code examples above into Sigil's Code View and then Tools > Reformat HTML > Mend and Prettify All HTML Files and see what happens. Last edited by Tex2002ans; 11-10-2019 at 02:00 AM. |
|
11-14-2019, 09:55 PM | #5 |
Enthusiast
Posts: 48
Karma: 10000
Join Date: Apr 2011
Device: iPad
|
It's so funny — I've been working in XHTML so long, I'd forgotten how much bad code you could get away with in vanilla HTML. ^.^
|
Advert | |
|
11-18-2019, 01:32 PM | #6 |
Member
Posts: 21
Karma: 10
Join Date: Jun 2012
Device: Samsung Note20 Ultra, Kindle Fire HD10
|
Thanks so much for the responses, but...
As much as I appreciate the number of them, none of you have really answered my question (that I probably asked badly).
My question: With respect to eBooks ONLY, what can XHTML do that HTML cannot? I would not consider myself an expert at HTML, but I've been editing my Sigil eBooks successfully for almost a decade now, and many of the cautions you made, I do watch out for, closing tags, proper syntax, etc. I also realize that it is what is *in* the file that makes it HTML. But because of that fact that for all the eBooks I edit, (and I do edit any Kindle eBooks I buy to combine individual stories together when it's a series), it seems like nothing outside the realm of HTML seems to occur. Thus the question. Most of what I do when I'm editing eBooks, (or rarely, writing an eBook), seems pretty straightforward. Occasionally, I will wish that there was a way to have a picture in the text with the text wrapped around it, but aside from that, I am fine. (and there probably is, but I don't know how) But with all the push for Sigil to be able to do things with XHTML (and it did handle it pretty well before), I'm wondering if there are things in my eBooks that I can do with XHTML that I CAN'T do with HTML. Is there anything that people do in eBooks that XHTML can do that HTML cannot? Once again, thank you for giving me much to think about, but I hope I can get some information to set my question to rest. FDWojo |
11-18-2019, 03:22 PM | #7 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
XHTML can do anything HTML can.
As was stated before, it's just more strict with what's a valid/well-formed file. Quote:
Or if you opened it up in Sigil, it already did the cleanup/changes for you. For example: HTML has rules like allowing capital letters, no quotes around attributes, and no strict need for a closing tag: HTML: Code:
<body> <BLOCKQUOTE> <P>This is a paragraph</p> <p CLASS=someclass>This is a second sentence Code:
<body> <blockquote> <p>This is a paragraph</p> <p class="someclass">This is a second sentence</p> </blockquote> </body> With XHTML, you're forced into making your code well-formed/consistent in the first place. As I said earlier... most of the differences are technical minutiae, so no need to go too deep into it. Last edited by Tex2002ans; 11-18-2019 at 04:15 PM. |
|
11-18-2019, 04:47 PM | #8 | |||
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
There's no such thing as HTML. At all, period. Anyone who told you HTML existed was completely and utterly wrong. Therefore, there cannot be any difference between HTML (which does not exist), and XHTML (which does exist). XHTML is an interesting language, which you've been *thinking of* as "HTML", because that "X" is too long and therefore it's fun to abbreviate it. One of its quirks is that if there are errors in XHTML, the renderer throws up its hands and says "hey, you're not allowed to do that. I refuse to even look at your file". Then it turns out HTML does in fact exist, even though we don't like to admit it. It's what happens if you take XHTML and remove the requirement that errors are errors. HTML is a bastardized form of XHTML, with the sole difference being that in the event of an error, HTML is permitted to randomly guess what it thinks you meant, instead of displaying an error message. So, the first step here is to define a glossary. Henceforth, we will refer to two terms.
Now, you have asked a question. "With respect to eBooks ONLY, what can XHTML do that files with errors in them cannot?" So, the answer to your question is that files with errors in them can "do" errors. But I don't know why you would want to do that, so don't do that. In fact, as has been repeatedly stated, EPUB does not permit files with errors in them, therefore you cannot use files with errors in them, regardless of what you call them. So it turns out that given the choice between XHTML and "files with errors in them"... you don't actually have a choice, there is only XHTML. Quote:
"it seems like nothing outside the realm of files with errors in them seems to occur." That's a pretty weird thing to say. The most obvious thing that occurs is the fact that there are no errors. Quote:
* -- discounting Sigil's support for additional resources like CSS or PNG or JPEG files, which is orthogonal to the current discussion. |
|||
Tags |
xhtml |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some files.html & toc.xhtml (also Cover.xhtml) | chaot | Workshop | 23 | 02-13-2017 12:20 PM |
html vs xhtml | cybmole | Sigil | 4 | 04-29-2014 11:22 AM |
HTML Or XHTML? | fcm52 | Workshop | 2 | 09-29-2013 01:10 PM |
HTML OR XHTML? Wich One To Use? | fcm52 | Workshop | 8 | 12-11-2012 09:23 PM |