[publican-list] Help with xsl customization

Joshua Wulf jwulf at redhat.com
Tue Nov 8 11:08:20 UTC 2011


On 11/08/2011 09:50 AM, Jeff Fearn wrote:
> On 11/04/2011 05:05 PM, Joshua Wulf wrote:
>> I'm trying to create a custom brand that renders
>> <mediaobject><videoobject>  in html as<iframe>, rather than<embed>.
>>
>> I've found what I think is the xsl that applies this tag, in
>> graphics.xsl [1]:
>>
>> <xsl:template match="videodata">
>>    <xsl:call-template name="process.image">
>>      <xsl:with-param name="tag" select="'iframe'"/>
>>      <xsl:with-param name="alt">
>>        <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
>>      </xsl:with-param>
>>    </xsl:call-template>
>> </xsl:template>
>>
>> [1] http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/graphics.xsl
>>
>> I'm not sure where this is imported in publican. It's not in
>> publican/datadir/xsl.
>>
>> I've created a publican brand [2] with a graphics.xsl file in it, with
>> the following contents:
>>
>> <?xml version='1.0'?>
>> <xsl:stylesheet
>>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>>
>>      <xsl:import
>> href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
>>      <xsl:import
>> href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/graphics.xsl"/>
>>
>> <xsl:template match="videodata">
>>    <xsl:call-template name="process.image">
>>      <xsl:with-param name="tag" select="'iframe'"/>
>>      <xsl:with-param name="alt">
>>        <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
>>      </xsl:with-param>
>>    </xsl:call-template>
>> </xsl:template>
>>
>> </xsl:stylesheet>
>>
>> [2] https://svn.devel.redhat.com/repos/ecs/toolkit/publican-redhat-video
>>
>> This doesn't work, though.
>>
>> Anyone know how to do this?
> 
> In your html.xsl file add:
> 
> <xsl:import 
> href="http://docbook.sourceforge.net/release/xsl/current/xhtml/graphics.xsl"/>
> 
> to the list of other imports.
> 
> Copy your videodata template in to html.xsl.
> 
> Delete your graphics.xsl file.
> 
> Rebuild brand.
> 
> Cheers, Jeff.
> 

Rocked it. Thanks Jeff.




More information about the publican-list mailing list