docbook-apps

  • 1.  Re: DocBook XSL*2* stylesheet reorganization

    Posted 03-07-2008 14:52
    / Norman Walsh <ndw@nwalsh.com> was heard to say:
    | Fair warning to those of you living on the bleeding edge.

    Ok. So I reconsidered a bit and didn't end up going the named-template
    route after all. But I did change things around. Here's the new idiom
    for XSLT2 customization layers:


    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:db="http://docbook.org/ns/docbook"
    xmlns:f="http://docbook.org/xslt/ns/extension"
    exclude-result-prefixes="xs db f"
    version="2.0">

    <xsl:import href="/path/to/base/format/docbook.xsl"/>

    <xsl:template match="/">

    <xsl:variable name="normalized" as="document-node()"
    select="f:cleanup-docbook(/)"/>


    <xsl:variable name="root" as="element()"
    select="f:docbook-root-element($normalized)"/>

    <xsl:apply-templates select="$root"/>
    </xsl:template>

    </xsl:stylesheet>

    Checking in now.

    Be seeing you,
    norm

    --
    Norman Walsh <ndw@nwalsh.com> | What is familiar is what we are
    http://www.oasis-open.org/docbook/ | used to; and what we are used to
    Chair, DocBook Technical Committee | is most difficult to 'Know'--that
    | is, to see as a problem; that is,
    | to see as strange, as distant, as
    | 'outside us'.-- Nietzsche



  • 2.  Re: [docbook-apps] Re: DocBook XSL*2* stylesheet reorganization

    Posted 03-07-2008 18:26
    Norman Walsh wrote:

    > / Norman Walsh <ndw@nwalsh.com> was heard to say:
    > | Fair warning to those of you living on the bleeding edge.

    > Here's the new idiom for XSLT2 customization layers:

    If you put this template rule in common/docbook.xsl, the
    customization layer can either override template rules for precise
    elements or override this template rule (matching "/") if he wants to
    make something more complicated that needs to take control over the
    overall processing.

    So the default rule for "/" launches the machinery as it should be,
    and if one wants to override the rule for "/" in the cust. layer, he
    will need to call the top-level functions (as in your email).

    Sounds more intuitive, doesn't it?

    Regards,

    --drkm























    _____________________________________________________________________________
    Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr