IDPF / epub3-samples

EPUB 3 Sample Documents
http://idpf.github.io/epub3-samples/
427 stars 163 forks source link

Invalid pageTarget type value? #11

Closed mpdunlop closed 7 years ago

mpdunlop commented 7 years ago

The NCX file for the ePub 3 samples uses the XML Namespace at http://www.daisy.org/z3986/2005/ncx/

This says the following about the pageTarget element:

<!-- Revised, 3/31/2004:  Added pageTarget element -->
<!-- Revised, 4/5/2004:  Added description of value attribute to comment -->
<!-- Page Target -  Container for 
  text, audio, image, and content elements containing navigational 
  information for pages.  The "value" attribute is a positive integer representing 
the numeric value associated with a page. Combination of values of type and 
value attributes must be unique, when value attribute is present. 
-->
<!ELEMENT pageTarget (navLabel+, content)>
<!-- Revised, 4/5/2004:  Added class attribute -->
<!-- Revised, 4/5/2004:  Changed declaration of type attribute to enumerate values -->
<!-- Revised, 4/5/2004:  Added playOrder -->
<!ATTLIST pageTarget
   id       ID          #IMPLIED
   value    CDATA       #IMPLIED
   type     (front | normal | special)       #REQUIRED
   class    CDATA       #IMPLIED
   playOrder CDATA      #REQUIRED
>

If I'm reading this correctly, the only permitted values for the pageTarget's type attribute are front, normal, and special.

Some of the examples listed in this repository use values other than these. Using https://github.com/IDPF/epub3-samples/blob/master/30/childrens-literature/EPUB/toc.ncx as an example:

        <pageTarget type="body">
            <navLabel>
                <text>169</text>
            </navLabel>
            <content src="s04.xhtml#Page_169"/>
        </pageTarget>

Is my interpretation of the spec correct? What is the meaning of the "body" pageTarget type?

mattgarrish commented 7 years ago

Yes, it's an error. Epubcheck uses an RNG-equivalent schema to validate, but it doesn't require the enumeration. See https://github.com/IDPF/epubcheck/blob/master/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng#L225

mpdunlop commented 7 years ago

Apologies for the delayed reply, it was a public holiday in my state. Thanks for this, and thanks for opening the bug ticket on the ePubCheck repository.

For people who are interested in the progress of this issue check https://github.com/IDPF/epubcheck/issues/761 and https://github.com/IDPF/epubcheck/pull/762

mattgarrish commented 7 years ago

I've also updated the sample in commit https://github.com/IDPF/epub3-samples/commit/0ef85d21ad15547e08743af59a4d23c358ee4805

I didn't find the issue in any of the other samples fortunately.