Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#389 html: pleaes support the whole bunch of HTML attributes

output: HTML
open
nobody
XSL (399)
5
2007-06-15
2007-06-15
Daniel Leidert
No

If the <table> or <informaltable> elements have HTML attributes (as allowed by DocBook XML 4 and probably 5 too), then pleaes copy them to the output. Please note, that the border attribute received from the frame attribute value may or may not overwrite the border attribute itself. IMHO in the case of HTML, the border attribute value should take precedence over the value derived from the frame attribute.

Discussion

  • Daniel Leidert
    Daniel Leidert
    2007-06-15

    Logged In: YES
    user_id=1102637
    Originator: YES

    I took a quick look into the code and suggets the following: a) Do not use the variables to only check for attributes. Better use it, to check for all sources, where the attribute value could come from. For the case of summary, I suggest using:

    <xsl:variable name="summary">
    <xsl:choose>
    <xsl:when test="../@summary">
    <xsl:value-of select="../@summary"/>
    </xsl:when>
    <xsl:when test="../textobject/phrase">
    <xsl:value-of select="../textobject/phrase"/>
    </xsl:when>
    <xsl:when test="processing-instruction('dbhtml[@table-summary]')">
    <xsl:call-template name="dbhtml-attribute">
    <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
    <xsl:with-param name="attribute" select="'table-summary'"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="../title">
    <xsl:value-of select="../title"/>
    </xsl:when>
    <xsl:otherwise><!-- nevermind --></xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    [..]
    <table>
    <xsl:if test="$summary != ''">
    <xsl:attribute name="summary">
    <xsl:value-of select="$summary"/>
    </xsl:attribute>
    </xsl:if>
    [..]

    And so I would do this for all HTML attributes, <table> supports, following:

    1. HTML-attribute
    2. possible highly fitting alternative nodes (like e.g. textobject/phrase)
    3. dbhtml attributes
    4./5. possible fallback nodes (like e.g. title)
    5./4. parameters
    6. leave it empty
    (general idea)

    Opinions, before I waste my time writing a more complete patch?

     
  • Daniel Leidert
    Daniel Leidert
    2007-06-15

    Logged In: YES
    user_id=1102637
    Originator: YES

    I forgot: the <xsl:when test="processing-instruction('dbhtml[@table-summary]')"> seems to fail. Here an improvemnt/fix is necessary (if possible).