Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid pageTarget type value? #11

Closed
mpdunlop opened this issue Jun 2, 2017 · 3 comments
Closed

Invalid pageTarget type value? #11

mpdunlop opened this issue Jun 2, 2017 · 3 comments

Comments

@mpdunlop
Copy link

mpdunlop commented Jun 2, 2017

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:/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
Copy link
Member

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

@mpdunlop
Copy link
Author

mpdunlop commented Jun 6, 2017

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
w3c/epubcheck#761 and w3c/epubcheck#762

@mpdunlop mpdunlop closed this as completed Jun 6, 2017
@mattgarrish
Copy link
Member

I've also updated the sample in commit 0ef85d2

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants