Forum OpenACS Q&A: Re: New package documentation

Collapse
Posted by Kurt Martin on
Greetings,

It is very simple to modify the Docbook XSLT in W@XML to make <sect1> vs <section> tags. Simply modify the XSLT. Changing the section tags to sect1 tags is easy. Simply replace the following:

<xsl:template match="h:div[parent::h:body]">
    <section>
      <xsl:apply-templates />
    </section>
</xsl:template>

With:

<xsl:template match="h:div[parent::h:body]">
    <sect1>
      <xsl:apply-templates />
    </sect1>
</xsl:template>

You may have to add a named style in word to pick up nested "sections", and detect this as a class attribute in the exported XML. For example, if you wanted to capture a style named "Heading4ArialNarrow" as your sect2's, then add the following to the Docbook XSLT:

<xsl:template match="h:p[attribute::class = 'Heading4ArialNarrow']">
    <sect2>
      <xsl:apply-templates />
    </sect2>
</xsl:template>

The standard output from W2XML captures each style name and adds it as a class attribute value. It is easy to capture this and modify however you wish.

HTH