![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
|
I THINK pretty-print used to fix this for me...
First up, this is not a complaint about the disappearance of pretty-print. I understand why it had to go.
Second up, I have no idea what I'm doing, so its mostly trial and error.... Here is my issue, and as I said in the title, I THINK pretty-print used to correct this issue for me, but unfortunately, I didn't pay enough attention as to how.... If, in an english language book (<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">, I have the code <span lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">Que nous étions encore à Frankfort</span>, everything seems OK until I try to validate it. I vaguely recall that (maybe?) pretty print used to change it to http://www.w3.org/XML/1998/namespace (I found this by searching the big web), or something similar, but if I try to use this (replacing the xmlns="http://www.w3.org/1999/xhtml" with xmlns="http://www.w3.org/XML/1998/namespace") I get an error "xml namespace URI cannot be the default namespace". FlightCrew tells me that attribute lang is not declared for element span near..... Some questions: 1) Is something like <lang="fr"....> able to be used in Sigil? 2) How do I declare "attribute lang" for "element span"? Am I on the sorta right track with what I have done, or an I completely missing something? Is there something that needs to be declared, instead in <head> or <html>? 3) Does anyone have any idea what I'm talking about? Phil |
![]() |
![]() |
![]() |
#2 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
The Epub Validtor reports no error when using <span lang ="en"> so it might be that Flightcrew is wrong in this case.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,361
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Pretty Print isn't gone. It's just not automatically done any more. Use Tools->Reformat Html->Mend/Mend + Prettify (also available from the Code View context menu) whenever you want to reformat/mend your code.
No version of Sigil that I know of changed the 1999 namespace to a 1998 one (and if the old htmltidy pretty-print ever "fixed" anything, I assure you it was entirely by accident. ![]() I don't believe you need the namespace in the span since that namespace is always added to the html tag. I'll look into old vs new behavior, though. |
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
|
The lang attribute has been deprecated. Have you tried just using the xml:lang attribute in its place and removing lang=blah attribute.
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,361
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Are you sure it's not the "language" attribute that's been deprecated for script elements?
According to what I'm seeing, "lang" should be valid for any element in html5, and there's only a handful of elements that lang can't be used with in html4.01 (I've seen it recommended to use both lang and xml:lang for xhtml delivered as text/html). I definitely see some IDPF Accessibility guidelines for epub3 recommending both--but it's entirely possible that I have my wires crossed. Specs make my eyes go crossed. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Here is the link that I read once before. See Example 3 which uses the xhtml 1.1 doctype near the end of this page. It does not use lang= anymore where as xhtml 1.0 does. http://www.w3.org/TR/WCAG20-TECHS/H57.html So perhaps the doctype does make the difference: Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> KevinH |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,361
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Also, doesn't that documentation only refer to using it with the html element? EDIT: You're right though ... getting rid of lang="fr" (and leaving xml:lang="fr") makes Flightcrew stop barking about it. Epubcheck doesn't seem to care whether it's there or not. Last edited by DiapDealer; 01-06-2016 at 01:41 PM. |
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
Yes, I think Flightcrew uses the specific DOCTYPE to correctly set the dtd used to validate things. If you change to use the older DOCTYPE (and be careful not to run it through mend or it will convert it back!) and then pass to Flightcrew, it may be accepted. The dtd is the key and if transitional vs strict. KevinH |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
|
Thanks gents. I'll have a play around with your suggestions above when I get home tonight.
|
![]() |
![]() |
![]() |
#10 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
|
A simple <span xml:lang="fr"> did the trick, and no-one (FlightCrew and ePubCheck) has an issue with it.
Thank you both. Phil |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil 0.7 Pretty print | exaltedwombat | Sigil | 37 | 02-21-2013 11:14 AM |
Print Not Working (nor print to PDF) | foxglove | Calibre | 5 | 03-02-2012 10:05 AM |
Print vs Pixel: retailers experiment with print/ebook bundles | DMcCunney | General Discussions | 42 | 09-15-2010 11:29 AM |
Please please please pretty please... | nortydog | Sony Reader Dev Corner | 1 | 01-09-2010 07:23 PM |