View Single Post
Old 09-26-2012, 08:32 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,410
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's a bug in XML. XML has no clear rules for how to interpret attributes with no namespace prefix. The spec says that default namespaces apply only to element names and not attribute names and that attribute names should be interpreted in the element namespace. But it also says that attribute with no prefix should be in the null namespace. So different XML tools deal with unprefixed attribute names differently. The XML library calibre uses treats unprefixed attributes to be in the default namespace, which means that there is no need to use opf:role, since opf is the default namespace already. Whatever XML library FC and epubcheck use makes a different assumption about how to interpret unprefixed namespaces, leading to the validation error. In practice, this validation error is meaningless, since tools that actually consume OPF either completely ignore the role attribute or handle both opf:role and role.
kovidgoyal is offline   Reply With Quote