Span element inside another span element inside nav

2 posts / 0 new
Last post


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 :

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

This can't validate with the schema found at 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>

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