ANNotunzdY
ANNotunzdY

Reputation: 399

Can I use custom xml namespace in ePub 3.0?

An error comes out by epub which uses custom namespaces in ePubChecker. Is using custom namespaces in ePub 3.0 forbidden?

example code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/TR/xhtml11" xmlns:customns="http://example.com">
<head></head>
<body><customns:customtag></customns:customtag></body>
</html>

ERROR:

/Untitled.epub/OPS/page0.html(5,27): element "customns:customtag" not allowed here; expected the element end-tag, text or element "a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "br", "button", "canvas", "cite", "code", "command", "datalist", "del", "details", "dfn", "div", "dl", "em", "embed", "fieldset", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "map", "mark", "menu", "meter", "nav", "ns1:switch", "ns1:trigger", "ns2:math", "ns3:svg", "object", "ol", "output", "p", "pre", "progress", "q", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "style", "sub", "sup", "table", "textarea", "time", "u", "ul", "var", "video" or "wbr" (with xmlns:ns1="http://www.idpf.org/2007/ops" xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/2000/svg")

Upvotes: 2

Views: 765

Answers (1)

palacsint
palacsint

Reputation: 28865

I've tried it with a Sony PRS-650. I didn't expect but it worked. The reader showed the text between the opening and closing tags.

As far as I see Epub 2.0.1 supports namespaces and Epub 3.0 draft does not remove this feature. XHTMLs are XMLs, so it could be fine but unless it's absolutely necessary I wouldn't use this feature. Maybe the firmware of other devices isn't so well tested and won't show the book.

Upvotes: 0

Related Questions