Sigil-Ebook / flightcrew

Automatically exported from code.google.com/p/flightcrew
GNU General Public License v3.0
34 stars 11 forks source link

content src in ncx broken if ncx not in epub root #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If I validate a valid epub (as per epubcheck 1.0.5) FC report errors like the 
following in ncx:

This <content> element's "src" attribute value is "fooBar.xml", but that file 
does not exist.

Apparently your code assume src path relative to the epub package root, not to 
the ncx position, so your validation fails (erroneously) if the ncx is in a 
subdirectory and references files in the same directory with relative paths.

This structure should validate correctly, but actually does not:

epub root
 |--mimetype
 |--META-INF
 |--OPS
    |--test.ncx
    |--fooBar.xml

fragment from test.ncx:
<navPoint class="a_class" id="an_uid" playOrder="1">
      <navLabel><text>Title</text></navLabel>
      <content src="fooBar.xml"/>
</navPoint>

Original issue reported on code.google.com by peppo.bo...@gmail.com on 27 Oct 2010 at 11:07

GoogleCodeExporter commented 9 years ago
Forgot to mention that the above is on 0.7.0 Windows.
If you need one, I can attach an epub test case.

Original comment by peppo.bo...@gmail.com on 27 Oct 2010 at 11:22

GoogleCodeExporter commented 9 years ago
Please attach a test case.

Original comment by Strahinja.Markovic@gmail.com on 28 Oct 2010 at 10:18

GoogleCodeExporter commented 9 years ago
BTW there must be something else that's the problem, because as you can see on 
line 36 in this file ( 
http://code.google.com/p/flightcrew/source/browse/src/FlightCrew/Validators/Ncx/
ContentTargetsPresent.cpp#36 ), the NCX's "parent path" (which is the path to 
the folder in which the NCX is located) is used as the base of relative URLs.

I'm looking forward to that test case, because something else must have 
exploded.

Original comment by Strahinja.Markovic@gmail.com on 28 Oct 2010 at 10:24

GoogleCodeExporter commented 9 years ago
OK, here is my test case.
It is an epub boilerplate valid under epubcheck 1.0.5, but FC reports the above 
mentioned errors on /OEBPS/chapter1.html and /OEBPS/front-cover.html .

Hope the clean up after the explosion will be not too hard :-) 

Original comment by peppo.bo...@gmail.com on 28 Oct 2010 at 11:02

Attachments:

GoogleCodeExporter commented 9 years ago
I'm sorry, but this test case passes without problems on my Windows and Linux 
machines. No errors are reported.

Original comment by Strahinja.Markovic@gmail.com on 28 Oct 2010 at 7:15

GoogleCodeExporter commented 9 years ago
Sorry, but the attached screenshot show the errors I get validating 
testCase.epub with FlightCrew-gui.exe (fresh install from 
FlightCrew-gui-0.7.0-Windows-Setup.exe) under WinXp.

Any cue???? 

Original comment by peppo.bo...@gmail.com on 28 Oct 2010 at 8:59

Attachments:

GoogleCodeExporter commented 9 years ago
Huh. This is bizarre. I get absolutely no error messages, with the 0.7.0 build 
or the dev build.

Original comment by Strahinja.Markovic@gmail.com on 28 Oct 2010 at 9:03

GoogleCodeExporter commented 9 years ago
I'll try to look into it more tomorrow. I may have more questions for you too.

Original comment by Strahinja.Markovic@gmail.com on 28 Oct 2010 at 9:03

GoogleCodeExporter commented 9 years ago
More than happy to help (if I can).
Thanks

Original comment by peppo.bo...@gmail.com on 28 Oct 2010 at 9:08