You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Petri Salmi <pe...@smartner.com> on 2003/06/11 09:24:58 UTC
Re: [issues] Updated: (FOR-41) Element TITLE passed on the
tranformation from sdocbook to document v11
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.
Re: [issues] Updated: (FOR-41) Element TITLE passed on the tranformation
from sdocbook to document v11
Posted by Juan Jose Pablos <ch...@che-che.com>.
> Thanks Patri!,
I am so sorry Petri!..
Re: [issues] Updated: (FOR-41) Element TITLE passed on the tranformation from sdocbook to document v11
Posted by Jeff Turner <je...@apache.org>.
On Thu, Jun 12, 2003 at 10:58:34AM +0200, Juan Jose Pablos wrote:
> Thanks Patri!,
>
> I would like to suggest
> <xsl:apply-templates select="*[not(self::title)]"/>
> is the quick fix, but someone has to agree to added to the cvs.
Applied now, sorry for the delay.
--Jeff
> Cheers
>
> Cheche
Re: [issues] Updated: (FOR-41) Element TITLE passed on the tranformation
from sdocbook to document v11
Posted by Juan Jose Pablos <ch...@che-che.com>.
Thanks Patri!,
I would like to suggest
<xsl:apply-templates select="*[not(self::title)]"/>
is the quick fix, but someone has to agree to added to the cvs.
I am going to put all this information on Jira, so we do not missed, Is
that o for you?
Cheers
Cheche
Petri Salmi wrote:
> 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?