Indeed, the xmlns errors indicate a problem in the stylesheet. You can't assign an element to a namespace by trying to assign an ordinary attribute with name "xmlns". It must use the namespace attribute on xsl:element.

Change this (and the like):

       <xsl:element name="item">
<xsl:attribute name="xmlns">http://www.idpf.org/2007/opf</xsl:attribute>

to this:

       <xsl:element name="item" namespace="http://www.idpf.org/2007/opf";>


Bob Stayton
Sagehill Enterprises
[email protected]


----- Original Message ----- From: "Eric Johnson" <[email protected]>
To: "Keith Fahlgren" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, March 26, 2009 3:10 PM
Subject: RE: [docbook-apps] Using ePub


Our system uses Ant and Saxon so the ruby script isn't really going to
work.

I tried building up an Ant target to do the packaging:
<target name="docbook.epub" description="Builds Epub output">
   <java classname="com.icl.saxon.StyleSheet"
classpathref="xslt-classpath" fork="true" dir="." maxmemory="512M">
     <sysproperty key="javax.xml.parsers.DocumentBuilderFactory"
value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" />
     <sysproperty key="javax.xml.parsers.SAXParserFactory"
value="org.apache.xerces.jaxp.SAXParserFactoryImpl" />
     <sysproperty
key="org.apache.xerces.xni.parser.XMLParserConfiguration"
value="org.apache.xerces.parsers.XIncludeParserConfiguration" />
     <arg value="-x" />
     <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader" />
     <arg value="-y" />
     <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader" />
     <arg value="-r" />
     <arg value="org.apache.xml.resolver.tools.CatalogResolver" />
     <arg value="${docbook.in}" />
     <arg value="${env.DBCK_HOME}/lib/docbook-xsl-ns/epub/docbook.xsl"
/>
     <arg value="target.database.document=${HTMLSITEMAP}" />
     <arg value="current.docid=${docbook.docid}" />
   </java>
   <copy todir="OEBPS/imagesdb">
     <fileset dir="${env.DBCK_HOME}/custom-ns/imagesdb" />
   </copy>
   <copy todir="OEBPS/images" failonerror="false">
     <fileset dir="images" />
   </copy>
   <delete file="output/${docbook.epub}" failonerror="false" />
   <echo file="mimetype">application/epub+zip</echo>
   <zip destfile="output/${docbook.epub}" whenempty="skip">
     <fileset dir="." includes="mimetype"/>
     <zipfileset dir="OEBPS" prefix="OEBPS" />
     <zipfileset dir="META-INF" prefix="META-INF" />
   </zip>
   <delete failonerror="false" includeemptydirs="true">
     <fileset dir="." includes="mimetype"/>
     <fileset dir="OEBPS" />
     <fileset dir="META-INF" />
   </delete>
 </target>

The problem I'm still running into is that the I get the following
string of errors:
[java] Recoverable error
[java] at xsl:attribute on line 380 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 559 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Writing OEBPS/toc.ncx
[java] Recoverable error
[java] at xsl:attribute on line 206 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] Recoverable error
[java] at xsl:attribute on line 739 of
file:/c:/dcbk/lib/docbook-xsl-ns/epub/docbook.xsl:
[java]   Invalid attribute name: xmlns
[java] No more warnings will be displayed
[java] Writing OEBPS/content.opf
[java] Writing META-INF/container.xml
[java] <?xml version="1.0" encoding="UTF-8"?>

And the package files have improper DTD specifications.

Am I missing an XSLT parameter or is this a Saxon issue?

-----Original Message-----
From: Keith Fahlgren [mailto:[email protected]]
Sent: Thursday, March 26, 2009 10:55 AM
To: Eric Johnson
Cc: [email protected]
Subject: Re: [docbook-apps] Using ePub

Hi,

On Wed, Mar 25, 2009 at 4:03 PM, Eric Johnson <[email protected]>
wrote:
I'm interested in generating ePub books from my DocBook 5.0 source and
was
wondering what steps I need to take.

I tried just running the XML through the ePub stylesheet and zipping
up the
results which mostly works. The resulting book opens in Stanza for
iPhone,
but not Stanza desktop. The desktop version generates a namespace
error. The
book also fails the on-line ePub validator.

Is there some customization I need to do? Do I need to also run the
Ruby
stuff to package the book correctly?

You do need to use some other program to invoke the stylesheets. The
README in epub/README
(https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/xsl/epub/READ
ME)
describes how to use the included Ruby command:

$ dbtoepub --help
 Usage: dbtoepub [OPTIONS] [DocBook Files]

 dbtoepub converts DocBook <book> and <article>s into to .epub files.

 .epub is defined by the IDPF at www.idpf.org and is made up of 3
standards:
 - Open Publication Structure (OPS)
 - Open Packaging Format (OPF)
 - Open Container Format (OCF)

 Specific options:
     -d, --debug                      Show debugging output.
     -h, --help                       Display usage info
     -v, --verbose                    Make output verbose

You may also be interested in other tools for invoking the
stylesheets, like Liza Daly's Python program docbook2epub:
http://code.google.com/p/epub-tools/


Keith



--------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to