Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 09-27-2016, 07:01 AM   #1
jkeinonen
Junior Member
jkeinonen began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2016
Device: Kindle, Kobo, tablet
Question Warning Attribute 'lang' is not declared, docx to epub, with FlightCrew

Hi!

This is my first post here. I read the stickies, don't think I need to attach files, searched but didn't find a similar case.

My problem is that when converting with Calibre (2.68 64-bit) from Word 2016 docx (Windows 7 64-bit) to epub, I get warnings on FlightCrew 0.72 of the kind "attribute 'lang' is not declared for element html (or i, or p)".

The warning does not affect the usability of the epub. However, the two biggest e-bookstores in the Finnish market, Elisa Kirja and iTunes, seem to have a similar validation system, so the warnings have to be fixed. I have been able to do that manually.

Here is a what the second line of index_split_000.html reads like:

<html xmlns="http://www.w3.org/1999/xhtml" lang="fi" xml:lang="fi">

Not understanding code very much, I have by trial and error learned that, in Calibre Edit mode, removing the part lang="fi" will make the warning go away.

Using the Find/Replace tool, in All text files mode, it has been quite easy to remove all the unwished lang="fi". But the recent conversion job had quotes in many other languages, leading to lang="de" etc. causing extra work and human error risk.

So, my questions and notes are:

1) Is there a switch or button in Calibre that I have missed, which could fix the mini-problem?

2) The "blame" probably lies at Microsoft as always, but if someone knows if there is a setting in Word 2016 that "kills" the wrong type of language marking, I'm happy to learn that instead.

3) Regarding the new multi-language issue vs. just one language (Finnish): I probably should, in Word 2016, select Ctrl-A and force everything to one language. So that's another workaround.

Finally, a huge thanks to Kovid Goyal and everyone helping with developing Calibre. I made a donation when I started using it, and will make another one if this issue proceeds.
jkeinonen is offline   Reply With Quote
Old 09-27-2016, 07:20 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just use the search and replace settings in the conversion dialog, no need to involve the editor at all.

Code:
Search:<([^>+]) lang=\S+([^>]*)>
Replace: <\1 \2>
Should do the trick.
kovidgoyal is online now   Reply With Quote
Advert
Old 09-27-2016, 08:17 AM   #3
jkeinonen
Junior Member
jkeinonen began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2016
Device: Kindle, Kobo, tablet
Thank you Kovid. I'm really afraid of using anything that looks like code, because I am totally amateur in that area, but I will have a deep look at this when I can concentrate!
jkeinonen is offline   Reply With Quote
Reply

Tags
docx input, epub, flightcrew


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub validation error help "attribute border is not declared for element img bmacklin ePub 12 11-06-2015 11:00 AM
Attribute 'target' is not declared for element 'a' Alda Sigil 5 01-30-2015 08:49 AM
attribute 'name' is not declared for element 'a' lballas Sigil 2 01-09-2014 06:03 PM
Help! ePub errors -- attribute link/text not declared katyya ePub 1 11-17-2011 02:13 PM
Validation: attribute 'start' is not declared for element 'ol' WS64 Sigil 4 10-06-2011 03:15 AM


All times are GMT -4. The time now is 09:44 AM.


MobileRead.com is a privately owned, operated and funded community.