Subject: Re: [xsl] Getting epub: namespace into root html element From: "Abel Braaksma (Exselt) abel@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 25 Jun 2014 10:37:00 -0000 |
Wendell Piez wapiez@xxxxxxxxxxxxxxx <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
dinsdag 24 juni 2014 15:41
<xsl:template match="@*|node()"> <xsl:copy> <xsl:namespace name="epub">http://www.idpf.org/2007/ops</xsl:namespace> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
(Note: untested. In particular I haven't checked what will happen to comments and processing instructions are matched with this template -- instead, trusting the language designers to have specified the right thing, i.e. that the xsl:namespace instruction is then ignored.)
<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>
The namespace will then be bound to every node in your result. Consequently you will see it declared on the document element in your output -- and probably nowhere else. (I say 'probably' because that is the way a well-designed serializer will do it, other things being equal.)
Cheers, Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Getting epub: namespace i, Wendell Piez wapiez@ | Thread | Re: [xsl] Getting epub: namespace i, Peter West lists@xxx |
[xsl] Re: XSL-FO question regarding, Mario Madunic mario. | Date | Re: [xsl] Getting epub: namespace i, Abel Braaksma (Exsel |
Month |