[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Getting epub: namespace into root html element

Subject: Getting epub: namespace into root html element
From: "Peter West lists@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Jun 2014 08:29:55 -0000
 Getting epub: namespace into root html element
I'm trying to convert EPUB2 files to EPUB3.  In the course of that, I need to
include some epub:type attributes. I also want to include a <!DOCTYPE html>
declaration, although I have seen it argued that the declaration is not
necessary.

I have managed to get the DOCTYPE declaration to work by a method that has
been described before in a number of places, and I have the epub:type
attributes appearing on the relevant elements.  However, the epub namespace is
declared on every element, and I haven't been able to get it into the root
element.  How can I do this?

My stylesheet starts like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xh="http://www.w3.org/1999/xhtml"
    xmlns:epub="http://www.idpf.org/2007/ops"
    exclude-result-prefixes="xs xh"
    version="2.0">

    <xsl:strip-space elements="*"/>
    <xsl:output method="xhtml" />
    <xsl:template match="/">
        <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html></xsl:text>
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>




Peter West

"...he who eats my flesh and drinks my blood has eternal life, and I will
raise him up at the last day."

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.