← Prev in month ← Prev in thread

Epub and Saxon: DOCTYPE revisited

From
Richard Hamilton <>
Date
2013-04-10T21:59:54+00:00
ID
Thread
Epub and Saxon: DOCTYPE revisited
Regarding Bob Stayton's message from a few days ago concerning Saxon not allowing a customization to override a DOCTYPE:

> Actually, once a doctype has been set by an xsl:output statement, a
> customization cannot reset it to nothing in Saxon.  That's a quirk of Saxon,
> confirmed by Michael Kay.  The epub stylesheet imports the xhtml-1_1/docbook.xsl
> stylesheet that sets the doctype.  The stylesheet tries to reset that to empty,
> and succeeds with xsltproc, but does not succeeed with Saxon.
> 
> You might try the epub3 stylesheets, which don't have this problem.  The other
> solution is to create your own version of xhtml-1_1/docbook.xsl that has an
> xsl:output statement without doctype, and then your own version of
> epub/docbook.xsl that imports it.  

Reading this, I thought you might be able to do a workaround like the following (this assumes you have a customization that imports epub/docbook.xsl):

1) Create an xsl file (I'll call it outputset.xsl) that contains just the following:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="UTF-8" indent="no" />
</xsl:stylesheet>

2) Import that file in your customization before importing epub/docbook.xsl. E.g.,
....
<xsl:import href="outputset.xsl"/>
<xsl:import href="...../epub/docbook.xsl"/>
....

Since outputset.xsl gets imported before either epub/docbook.xsl or xhtml-1_1/docbook.xsl, it would seem like this xsl:output method would prevail. However, when I tried this it had no effect.

My question is, am I misunderstanding the import mechanism, are the contents of outputset.xsl incorrect, or is something else going wrong?

I'm going to go ahead with Bob's suggestion, but any ideas/explanation concerning why this workaround doesn't work would be welcome.

Best Regards,
Dick Hamilton
-------
XML Press
XML for Technical Communicators
http://xmlpress.net
← Prev in month ← Prev in thread