Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-20-2018, 09:37 AM   #1
thiago.eec
Connoisseur
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 83
Karma: 71600
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
NCX dtb:depth incorrectly set

Hey, guys!

Please take a look at the NCX file below.

NCX File:
Spoiler:

Code:
<?xml version='1.0' encoding='utf-8'?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="pt-BR">
	<head>
		<meta content="uuid:6e4c4cdf-edf5-4330-8204-7dfc3a8414cf" name="dtb:uid"/>
		<meta content="3" name="dtb:depth"/>
		<meta content="calibre (3.35.0)" name="dtb:generator"/>
		<meta content="0" name="dtb:totalPageCount"/>
		<meta content="0" name="dtb:maxPageNumber"/>
	</head>
	<docTitle>
		<text>Hannibal: A origem do mal</text>
	</docTitle>
	<navMap>
		<navPoint id="num_1" playOrder="1">
			<navLabel>
				<text>Capa</text>
			</navLabel>
			<content src="OEBPS/Text/Capa.xhtml"/>
		</navPoint>
		<navPoint id="num_2" playOrder="2">
			<navLabel>
				<text>Edições BestBolso</text>
			</navLabel>
			<content src="OEBPS/Text/Autor.xhtml"/>
		</navPoint>
		<navPoint id="num_3" playOrder="3">
			<navLabel>
				<text>Rosto</text>
			</navLabel>
			<content src="OEBPS/Text/Rosto.xhtml"/>
		</navPoint>
		<navPoint id="num_4" playOrder="4">
			<navLabel>
				<text>Créditos</text>
			</navLabel>
			<content src="OEBPS/Text/Creditos.xhtml"/>
		</navPoint>
		<navPoint id="num_5" playOrder="5">
			<navLabel>
				<text>Sumário</text>
			</navLabel>
			<content src="OEBPS/Text/Sumario.xhtml"/>
		</navPoint>
		<navPoint id="num_6" playOrder="6">
			<navLabel>
				<text>Prólogo</text>
			</navLabel>
			<content src="OEBPS/Text/Prologo.xhtml"/>
		</navPoint>
		<navPoint id="num_7" playOrder="7">
			<navLabel>
				<text>Parte I</text>
			</navLabel>
			<content src="OEBPS/Text/Parte-I.xhtml"/>
			<navPoint id="num_8" playOrder="8">
				<navLabel>
					<text>1</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-01.xhtml"/>
			</navPoint>
			<navPoint id="num_9" playOrder="9">
				<navLabel>
					<text>2</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-02.xhtml"/>
			</navPoint>
			<navPoint id="num_10" playOrder="10">
				<navLabel>
					<text>3</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-03.xhtml"/>
			</navPoint>
			<navPoint id="num_11" playOrder="11">
				<navLabel>
					<text>4</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-04.xhtml"/>
			</navPoint>
			<navPoint id="num_12" playOrder="12">
				<navLabel>
					<text>5</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-05.xhtml"/>
			</navPoint>
			<navPoint id="num_13" playOrder="13">
				<navLabel>
					<text>6</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-06.xhtml"/>
			</navPoint>
			<navPoint id="num_14" playOrder="14">
				<navLabel>
					<text>7</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-07.xhtml"/>
			</navPoint>
			<navPoint id="num_15" playOrder="15">
				<navLabel>
					<text>8</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-08.xhtml"/>
			</navPoint>
			<navPoint id="num_16" playOrder="16">
				<navLabel>
					<text>9</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-09.xhtml"/>
			</navPoint>
			<navPoint id="num_17" playOrder="17">
				<navLabel>
					<text>10</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-10.xhtml"/>
			</navPoint>
			<navPoint id="num_18" playOrder="18">
				<navLabel>
					<text>11</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-11.xhtml"/>
			</navPoint>
			<navPoint id="num_19" playOrder="19">
				<navLabel>
					<text>12</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-12.xhtml"/>
			</navPoint>
			<navPoint id="num_20" playOrder="20">
				<navLabel>
					<text>13</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-13.xhtml"/>
			</navPoint>
			<navPoint id="num_21" playOrder="21">
				<navLabel>
					<text>14</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-14.xhtml"/>
			</navPoint>
			<navPoint id="num_22" playOrder="22">
				<navLabel>
					<text>15</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-15.xhtml"/>
			</navPoint>
			<navPoint id="num_23" playOrder="23">
				<navLabel>
					<text>16</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-16.xhtml"/>
			</navPoint>
			<navPoint id="num_24" playOrder="24">
				<navLabel>
					<text>17</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-17.xhtml"/>
			</navPoint>
			<navPoint id="num_25" playOrder="25">
				<navLabel>
					<text>18</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-18.xhtml"/>
			</navPoint>
			<navPoint id="num_26" playOrder="26">
				<navLabel>
					<text>19</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-19.xhtml"/>
			</navPoint>
			<navPoint id="num_27" playOrder="27">
				<navLabel>
					<text>20</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-20.xhtml"/>
			</navPoint>
			<navPoint id="num_28" playOrder="28">
				<navLabel>
					<text>21</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-21.xhtml"/>
			</navPoint>
			<navPoint id="num_29" playOrder="29">
				<navLabel>
					<text>22</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-22.xhtml"/>
			</navPoint>
			<navPoint id="num_30" playOrder="30">
				<navLabel>
					<text>23</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-23.xhtml"/>
			</navPoint>
			<navPoint id="num_31" playOrder="31">
				<navLabel>
					<text>24</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-24.xhtml"/>
			</navPoint>
			<navPoint id="num_32" playOrder="32">
				<navLabel>
					<text>25</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-25.xhtml"/>
			</navPoint>
			<navPoint id="num_33" playOrder="33">
				<navLabel>
					<text>26</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-26.xhtml"/>
			</navPoint>
			<navPoint id="num_34" playOrder="34">
				<navLabel>
					<text>27</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-27.xhtml"/>
			</navPoint>
			<navPoint id="num_35" playOrder="35">
				<navLabel>
					<text>28</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-28.xhtml"/>
			</navPoint>
			<navPoint id="num_36" playOrder="36">
				<navLabel>
					<text>29</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-29.xhtml"/>
			</navPoint>
			<navPoint id="num_37" playOrder="37">
				<navLabel>
					<text>30</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-30.xhtml"/>
			</navPoint>
			<navPoint id="num_38" playOrder="38">
				<navLabel>
					<text>31</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-31.xhtml"/>
			</navPoint>
			<navPoint id="num_39" playOrder="39">
				<navLabel>
					<text>32</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-32.xhtml"/>
			</navPoint>
		</navPoint>
		<navPoint id="num_40" playOrder="40">
			<navLabel>
				<text>Parte II</text>
			</navLabel>
			<content src="OEBPS/Text/Parte-II.xhtml"/>
			<navPoint id="num_41" playOrder="41">
				<navLabel>
					<text>33</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-33.xhtml"/>
			</navPoint>
			<navPoint id="num_42" playOrder="42">
				<navLabel>
					<text>34</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-34.xhtml"/>
			</navPoint>
			<navPoint id="num_43" playOrder="43">
				<navLabel>
					<text>35</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-35.xhtml"/>
			</navPoint>
			<navPoint id="num_44" playOrder="44">
				<navLabel>
					<text>36</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-36.xhtml"/>
			</navPoint>
			<navPoint id="num_45" playOrder="45">
				<navLabel>
					<text>37</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-37.xhtml"/>
			</navPoint>
			<navPoint id="num_46" playOrder="46">
				<navLabel>
					<text>38</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-38.xhtml"/>
			</navPoint>
			<navPoint id="num_47" playOrder="47">
				<navLabel>
					<text>39</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-39.xhtml"/>
			</navPoint>
			<navPoint id="num_48" playOrder="48">
				<navLabel>
					<text>40</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-40.xhtml"/>
			</navPoint>
			<navPoint id="num_49" playOrder="49">
				<navLabel>
					<text>41</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-41.xhtml"/>
			</navPoint>
			<navPoint id="num_50" playOrder="50">
				<navLabel>
					<text>42</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-42.xhtml"/>
			</navPoint>
			<navPoint id="num_51" playOrder="51">
				<navLabel>
					<text>43</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-43.xhtml"/>
			</navPoint>
			<navPoint id="num_52" playOrder="52">
				<navLabel>
					<text>44</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-44.xhtml"/>
			</navPoint>
			<navPoint id="num_53" playOrder="53">
				<navLabel>
					<text>45</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-45.xhtml"/>
			</navPoint>
			<navPoint id="num_54" playOrder="54">
				<navLabel>
					<text>46</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-46.xhtml"/>
			</navPoint>
			<navPoint id="num_55" playOrder="55">
				<navLabel>
					<text>47</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-47.xhtml"/>
			</navPoint>
			<navPoint id="num_56" playOrder="56">
				<navLabel>
					<text>48</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-48.xhtml"/>
			</navPoint>
			<navPoint id="num_57" playOrder="57">
				<navLabel>
					<text>49</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-49.xhtml"/>
			</navPoint>
			<navPoint id="num_58" playOrder="58">
				<navLabel>
					<text>50</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-50.xhtml"/>
			</navPoint>
			<navPoint id="num_59" playOrder="59">
				<navLabel>
					<text>51</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-51.xhtml"/>
			</navPoint>
			<navPoint id="num_60" playOrder="60">
				<navLabel>
					<text>52</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-52.xhtml"/>
			</navPoint>
			<navPoint id="num_61" playOrder="61">
				<navLabel>
					<text>53</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-53.xhtml"/>
			</navPoint>
			<navPoint id="num_62" playOrder="62">
				<navLabel>
					<text>54</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-54.xhtml"/>
			</navPoint>
			<navPoint id="num_63" playOrder="63">
				<navLabel>
					<text>55</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-55.xhtml"/>
			</navPoint>
			<navPoint id="num_64" playOrder="64">
				<navLabel>
					<text>56</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-56.xhtml"/>
			</navPoint>
			<navPoint id="num_65" playOrder="65">
				<navLabel>
					<text>57</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-57.xhtml"/>
			</navPoint>
		</navPoint>
		<navPoint id="num_66" playOrder="66">
			<navLabel>
				<text>Parte III</text>
			</navLabel>
			<content src="OEBPS/Text/Parte-III.xhtml"/>
			<navPoint id="num_67" playOrder="67">
				<navLabel>
					<text>58</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-58.xhtml"/>
			</navPoint>
			<navPoint id="num_68" playOrder="68">
				<navLabel>
					<text>59</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-59.xhtml"/>
			</navPoint>
			<navPoint id="num_69" playOrder="69">
				<navLabel>
					<text>60</text>
				</navLabel>
				<content src="OEBPS/Text/Capitulo-60.xhtml"/>
			</navPoint>
		</navPoint>
		<navPoint id="num_70" playOrder="70">
			<navLabel>
				<text>Agradecimentos</text>
			</navLabel>
			<content src="OEBPS/Text/Agradecimentos.xhtml"/>
		</navPoint>
	</navMap>
</ncx>

It seems like the value for the "dtb:depth" property on NCX heading is being incorrectly set by calibre. The value should be "2", since there are only 2 levels on the TOC. After testing with other books, it looks like calibre always increase the value by 1.

Am I missing something? Or is my assuption incorrect and the value should really be "3" for some reason?

Last edited by thiago.eec; 12-20-2018 at 09:39 AM.
thiago.eec is offline   Reply With Quote
Old 12-20-2018, 11:04 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: 33,935
Karma: 10254170
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
depends on whether you consdier the counting 0 based or 1 based. calibre has always done this 1- based, it's not going to change at this point.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-20-2018, 01:28 PM   #3
thiago.eec
Connoisseur
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 83
Karma: 71600
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
depends on whether you consdier the counting 0 based or 1 based. calibre has always done this 1- based, it's not going to change at this point.
Kovid,

Ok. Since it's 1 based, the value should be 1 or more, right?
That's also what is defined by the specs:
Quote:
dtb:depth
Content: Positive integer indicating depth of structure of the DTB as exposed by the NCX.
Occurrence: Required
But the way calibre sets this value, a flat TOC gets a depth of 2. Shouldn't it be 1?
thiago.eec is offline   Reply With Quote
Old 12-20-2018, 10:52 PM   #4
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: 33,935
Karma: 10254170
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No an empty toc gets 1, in other words the root node is depth 1 not depth 0
kovidgoyal is offline   Reply With Quote
Old 12-21-2018, 06:06 AM   #5
thiago.eec
Connoisseur
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 83
Karma: 71600
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Ok. Thank you, Kovid.
thiago.eec is offline   Reply With Quote
Advert
Reply

Tags
depth, ncx, ncx toc levels, toc levels

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
another Better World Books sale - DTB for scanning - thru mid-day 8/24 sufue Deals and Resources (No Self-Promotion or Affiliate Links) 0 08-22-2012 03:37 PM
$5 mp3 credit with purchase of new DTB Amazon textbook thru 9/30/2012 sufue Deals and Resources (No Self-Promotion or Affiliate Links) 0 08-07-2012 10:32 AM
Better World Books 20% off 4 or more DTB sufue Deals and Resources (No Self-Promotion or Affiliate Links) 0 07-24-2012 07:58 PM
dtb:totalPageCount & dtb:maxPageNumber...what is the function? twedigteam ePub 1 04-11-2011 06:40 PM
Can Calibre manage DTB books also????? bookmonster Calibre 0 08-23-2010 03:47 PM


All times are GMT -4. The time now is 09:56 PM.


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