docbook-apps

Expand all | Collapse all

Re: [docbook-apps] DocBook epub3 beta 3 stylesheets available

  • 1.  Re: [docbook-apps] DocBook epub3 beta 3 stylesheets available

    Posted 10-04-2011 15:50
    Hi Jirka,
    I just tried changing the following template in template/titlepage.xsl:

    <xsl:template match="t:templates">
    <xsl:element name="xsl:stylesheet">

    <xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute>

    and it seems to add

    xmlns="http://www.w3.org/1999/xhtml"

    in the right place. That seems too easy. I'm used to doing all kinds of contortions
    to get namespaces correct. But I guess in this case we are not actually handling a
    namespace.

    If it is that easy, then we could add a stylesheet parameter to
    template/titlepage.xsl to specify a default namespace, and conditionally add it if
    not blank. The customizer would have to know to set the param, but I think that
    would be ok.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net





  • 2.  Change in titlepage mechanism (Re: [docbook-apps] DocBook epub3 beta 3 stylesheets available)

    Posted 10-04-2011 21:41
    On 4.10.2011 17:49, Bob Stayton wrote:

    > <xsl:template match="t:templates">
    > <xsl:element name="xsl:stylesheet">
    >
    > <xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute>
    >
    > and it seems to add
    >
    > xmlns="http://www.w3.org/1999/xhtml"
    >
    > in the right place. That seems too easy. I'm used to doing all kinds
    > of contortions to get namespaces correct. But I guess in this case we
    > are not actually handling a namespace.

    Hi Bob,

    this should raise error as xmlns is not attribute in XPath data model.
    Saxon throws the following message:

    Recoverable error
    at xsl:attribute on line 78 of
    file:/e:/src/db/xsl/epub3/../template/titlepage.xsl:
    Invalid attribute name: xmlns

    and xmlns is ignored. Of course this is little bit edge case so other
    processors might give different results.

    > If it is that easy, then we could add a stylesheet parameter to
    > template/titlepage.xsl to specify a default namespace, and
    > conditionally add it if not blank. The customizer would have to know
    > to set the param, but I think that would be ok.

    I have added ns parameter to titlepage.xsl. It has to be set for FO and
    XHTML, but should be empty for HTML. I have used different means for
    setting namespace, but result seems ok. I have modified Makefiles as
    well. You can see it as revision 9112.

    We should warn users in release notes that when generating custom
    titlepage templates this additional parameter has to be set fo FO/XHTML.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------