docbook-apps

  • 1.  should xml:id be inside TITLE or SECT1?

    Posted 11-25-2009 21:55
    I am creating a book mainly for PDF rendering but also for
    ebook/chunked html output.

    I'll be including cross-references throughout; I don't expect to do a
    lot of fancy customizations.

    Is there a preferred method for when to use xml:id?

    <sect1 xml:id="wifi">

    <para>......</sect1>

    OR

    <sect1>

    <para> </para> </sect1>

    Does it make a difference? Are there advantages to putting it in the
    title rather rather than the sect1 element? Opinions? Thanks...

    rj
    --
    Robert Nagle
    htpt://www.robertnagle.info



  • 2.  Re: [docbook-apps] should xml:id be inside TITLE or SECT1?

    Posted 11-26-2009 07:50
      |   view attached
    Hi,

    semantically speaking, I guess that when you want to reference an item,
    you mean to point to the section, and not the title of it. Because if
    you use



    you tell the processors that the ID applies only to the title, not the
    section. And actually the way xref elements are processed expects that
    the ID is on the structural element (chapter, section, figure, etc.).
    So the correct syntax is

    <sect1 xml:id="wifi">

    just test :-)

    Camille.

    Robert Nagle wrote:
    > I am creating a book mainly for PDF rendering but also for
    > ebook/chunked html output.
    >
    > I'll be including cross-references throughout; I don't expect to do a
    > lot of fancy customizations.
    >
    > Is there a preferred method for when to use xml:id?
    >
    > <sect1 xml:id="wifi">
    >
    > <para>......</para></sect1>
    >
    > OR
    >
    > <sect1>
    >
    > <para> </para> </sect1>
    >
    > Does it make a difference? Are there advantages to putting it in the
    > title rather rather than the sect1 element? Opinions? Thanks...
    >
    > rj
    >

    </sect1>

    Attachment(s)

    vcf
    camille.vcf   272 B 1 version


  • 3.  [docbook-apps] Converting Website to DB5: suppressing version="5.0" attribute on children of root

    Posted 11-26-2009 13:48
    I'm working on an XSL 1.0 stylesheet that processes a DocBook Website
    autolayout file, transforming its Website pages into DocBook 5 articles.
    My stylesheet imports Norm's db4-upgrade.xsl, which does most of the
    work. My output is valid, and looks fine except for one nagging detail:
    some elements are transformed with 'version="5.0" attributes.

    Sample output:
    =====================
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:m="http://www.w3.org/1998/Math/MathML"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="upreview">





    <para version="5.0">From
    <citetitle>Pixar Gone Too Far This Time</citetitle>: </para>



    <para><quote>If the Pixar sensibility seemed strangely locked in to
    a mid-20th century mindset, well, they made it clear they intended to
    inherit the Disney mantle, didn’t they?</quote></para>

    ...




    =====================

    Notice that all the children of
    (except for
    <xsl:apply-templates select="exsl:node-set($converted)/*"
    mode="addNS"/>


    </saxon:output>
    </xsl:for-each>
    <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="config"/>
    <xsl:template match="autolayout/title"/>
    <xsl:template match="autolayout/summary"/>
    <xsl:template match="head"/>
    <xsl:template match="layout/style"/>
    <xsl:template match="webtoc"/>

    </xsl:stylesheet>




  • 4.  Re: [docbook-apps] Converting Website to DB5: suppressing version="5.0" attribute on children of root

    Posted 11-27-2009 14:36
    As usual, I should have dug a little more before asking for help. Found
    the source of my problem:

    In db4-upgrade.xsl, the "*" mode="AddNS" template adds a version
    attribute to the root element, like this:

    <xsl:if test="not(parent::*)">
    <xsl:attribute name="version">5.0</xsl:attribute>
    </xsl:if>

    In my customization (maybe because my root is different from what
    db4-upgrade.xsl expects) the test for parent in this template doesn't
    work as expected, so the attribute is applied to some elements under the
    root.

    However, my customization explicitly converts webpages to articles, and
    hardcodes the NS and version attributes on the generated

    element. So I customized the AddNS template in my stylesheet by deleting
    the lines shown above. It seems to work fine as far as I can tell.

    Thanks,
    Denis