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: footnote/para/programlisting -> invalid XHTML


Hi,

Don't really know what to do with this so I'll post it here.
Please bear with me.

I have a problem with how the XSL stylesheets (nwalsh) transform
footnote/para/programlisting to XHTML.
xsltproc, make.valid.html=1, html.cleanup=1
Output:
    <div class="footnote"><p> ... <pre class="programlisting">
<pre> inside <p> is invalid XHTML.

I fixed it by modifying the template which matches
"footnote/para[1]|footnote/simpara[1]" (in footnote.xsl) to call
the "paragraph" template (in block.xsl) which then calls "unwrap.p"
-- just as the template which matches "para" (in block.xsl) does.


<xsl:template match="footnote/para[1]|footnote/simpara[1]" priority="2">
  <!-- this only works if the first thing in a footnote is a para, -->
  <!-- which is ok, because it usually is. -->
  <xsl:variable name="name">
    <xsl:text>ftn.</xsl:text>
    <xsl:call-template name="object.id">
      <xsl:with-param name="object" select="ancestor::footnote"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="href">
    <xsl:text>#</xsl:text>
    <xsl:call-template name="object.id">
      <xsl:with-param name="object" select="ancestor::footnote"/>
    </xsl:call-template>
  </xsl:variable>
  <!-- - - - - - - - - - - - - - - - - - - - - ORIGINAL { - - - - -->
  <!--<![CDATA[
  <p>
    <xsl:if test="@role and $para.propagates.style != 0">
      <xsl:apply-templates select="." mode="class.attribute">
        <xsl:with-param name="class" select="@role"/>
      </xsl:apply-templates>
    </xsl:if>
    <sup>
      <xsl:text>[</xsl:text>
      <a id="{$name}" href="{$href}">
        <xsl:apply-templates select="." mode="class.attribute"/>
        <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
      </a>
      <xsl:text>] </xsl:text>
    </sup>
    <xsl:apply-templates/>
  </p>
  ]]>-->
  <!-- - - - - - - - - - - - - - - - - - - - - ORIGINAL } - - - - -->
  <!-- - - - - - - - - - - - - - - - - - - - - NEW { - - - - -->
  <xsl:call-template name="paragraph">
    <xsl:with-param name="class">
      <xsl:if test="@role and $para.propagates.style != 0">
        <xsl:value-of select="@role"/>
      </xsl:if>
    </xsl:with-param>

    <xsl:with-param name="content">
      <sup>
        <xsl:text>[</xsl:text>
        <a id="{$name}" href="{$href}">
          <xsl:apply-templates select="." mode="class.attribute"/>
          <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
        </a>
        <xsl:text>] </xsl:text>
      </sup>
      <xsl:apply-templates/>
    </xsl:with-param>

  </xsl:call-template>
  <!-- - - - - - - - - - - - - - - - - - - - - NEW } - - - - -->
</xsl:template>


    Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
-- 


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