OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Docbook Info with HTML content in XML


Hi all,

I might be over reaching here. I have a collection of Docbook 5.1 articles that I want to use as a data source in an app.

I want to retain all docbook info but have the content in html rather than docbook.

Below is my current stylesheet. It works in that I get what I had expected in XML, however I can't use xpath as there is something invalid. My guess is that it is to do with namespaces. I can parse it when I exclude the html content but not when it is included.

Any pointers welcome,

Thanks,

Peter

<xsl:import href="http://cdn.docbook.org/release/xsl/current/xhtml5/docbook.xsl"/> <xsl:output method="xml" omit-xml-declaration="no" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="*" mode="process.root">
  <book>
      <xsl:apply-templates select="."/>
    </book>
</xsl:template>

<xsl:template match="d:book">
    <xsl:copy-of select="d:info" />
    <xsl:apply-templates/>
</xsl:template>

<xsl:template match="d:article">
<article>
  <xsl:copy-of select="d:info" />
  <xsl:call-template name="id.warning"/>

<xsl:element name="html:{$div.element}" namespace="http://www.w3.org/1999/xhtml";>
    <xsl:call-template name="common.html.attributes">
      <xsl:with-param name="inherit" select="1"/>
    </xsl:call-template>
    <xsl:call-template name="id.attribute">
      <xsl:with-param name="conditional" select="0"/>
    </xsl:call-template>

    <xsl:call-template name="article.titlepage"/>

    <xsl:variable name="toc.params">
      <xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
      </xsl:call-template>
    </xsl:variable>

    <xsl:call-template name="make.lots">
      <xsl:with-param name="toc.params" select="$toc.params"/>
      <xsl:with-param name="toc">
        <xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>

    <xsl:apply-templates/>
    <xsl:call-template name="process.footnotes"/>
  </xsl:element>
</article>
</xsl:template>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]