forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petri Salmi <petri.sa...@smartner.com>
Subject Re: [issues] Updated: (FOR-41) Element TITLE passed on the tranformation from sdocbook to document v11
Date Wed, 11 Jun 2003 07:24:58 GMT
issues@cocoondev.org wrote:
> Given a sdocbook format with an image the title element on the figure context is copied
across. So it produce an invalid HTML code.
> 
> I found the part that creates this problem:
> 
>       <xsl:template match="figure">
>             <table>
>                   <tr>
>                         <td>
>                           <xsl:value-of select="title"/>
>                         </td>
>                   </tr>
>                   <xsl:apply-templates />
>             </table>
>       </xsl:template>
> 
> But I do not know of a way to ignore just the title element and select everything else.

I think an elegant way to do this would be to use XSLT modes:

You could replace <xsl:apply-templates /> with 
<xsl:apply-templates mode="figure"/>

and create two templates:

<xsl:template match="title" mode="figure"/>

<xsl:template match="*" mode="figure">
  <xsl:apply-templates/>
</xsl:template>

If you don't need to exclude anything but the title, you could always
use <xsl:apply-templates select="*[not(self::title)]"/>
instead of the seven apply-templates. 

If the order of the elements is important, I think you must 
at least fix the apply-templates to
<xsl:apply-templates
select="blockquote|informaltable|link|literallayout|mediaobject|programlisting|ulink"/>

Otherwise the elements will appear in output exactly in the order of 
the apply-templates.



- psalmi

p.s.  Should this comment be added to Jira instead?
-- 
Petri Salmi
Chief Architect
Oy Smartner Information Systems Ltd.


Mime
View raw message