Span element inside another span element inside nav

2 posts / 0 new
Last post

Hi,

I'm trying to generate ePub 3 on the fly with database content, which are valid xhtml.

I got a strange case : one of my document got span tag inside another span tag.
For example :

<nav>
<ol>
<li><span class="myclass"><span xml:lang="mylang">my text</span></span></li>
</ol>
</nav>

This can't validate with the schema found at http://www.idpf.org/epub/30/schema/epub-nav-30.sch because first span does not have text content, but another element :

<pattern id="span-labels">
<rule context="html:nav//html:ol//html:span">
<assert test="string-length(normalize-space(string(.))) > 0">Spans within nav element must contain text</assert>
</rule>
</pattern>

Is this an error, or a desired comportment ?
If so, is there a way to fix this ?

Thanks in advance,

Best regards

The schematron assertion is testing the stringified value of the first span to ensure that it is non-empty, so the only way it could fail, at least that I can see, is if you only include an image or some other element with no text content. Or, in other words, it's like taking a value-of of the element, so child wrapper elements are irrelevant.

What version of epubcheck generates an error for this content? I tried in 3.0 and the new 3.0.1 and can't get an error from the noted markup.

Secondary menu