xsl-list
[Top] [All Lists]

Re: [xsl] Getting epub: namespace into root html element

2014-06-27 19:48:09
On 25 Jun 2014, at 8:37 pm, Abel Braaksma (Exselt) abel(_at_)exselt(_dot_)net 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
...

Indeed, the xsl:namespace instruction will be ignored or used for all node 
types except document nodes, which will raise an error. In addition, if the 
stylesheet is complex, you may want to just add the namespace node to the 
root node, so that you do not have to add it to all your other node creation 
instructions:

<xsl:template match="/*">
<xsl:copy>
<xsl:namespace name="epub">http://www.idpf.org/2007/ops</xsl:namespace>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

Hi Abel,

This also works, provided I retain the original
    
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

as well.  And as you noted, XSLT 3.0 provides html5 output.

Peter West

"...for I am gentle and lowly in heart, and you will find rest for your souls."

Peter West

"...for I am gentle and lowly in heart, and you will find rest for your souls."
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>