List Info

Thread: selectively add a border to graphics




selectively add a border to graphics
user name
2007-11-05 03:23:38
Hi guys,

Does anybody know how should I customize the graphics.xsl in order to selectively create a border around graphics in my HTML output? For PDF, it works nicely, but I can't find place in graphics.xsl to do the same thing for HTML.

For graphics.xsl in fo, you should add just:

<fo:external-graphic>
<;xsl:if test="ancestor::figure[role='bordered']">
<xsl:attribute name="border-color"&gt;black</xsl:attribute>
<;xsl:attribute name="border-style"&gt;solid</xsl:attribute>
<;/xsl:if>;
But what about HTML?

Thanks in advance!

Kind regards,
Roman

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: selectively add a border to graphics
user name
2007-11-06 06:53:17
Hi,

I dont't know much yet about how DocBook XSL works, but to
create a
border around an image in HTML, add the following
attribute:

<xsl:attribute name="style">border-color:
black; border-style:
solid;</xsl:attribute>

resp.

<img style="border-color:black; border-style:
solid;" ...

Note all style is in one attribute in HTML, instead of
single attributes
like in FO.

Beats me where that must be added. Hopes it helps anyway.

Regards
Kilian

Am Montag, den 05.11.2007, 01:23 -0800 schrieb Roman Banks:
> Hi guys,
> 
> Does anybody know how should I customize the
graphics.xsl in order to
> selectively create a border around graphics in my HTML
output? For
> PDF, it works nicely, but I can't find place in
graphics.xsl to do the
> same thing for HTML.
> 
> For graphics.xsl in fo, you should add just:
> 
> <fo:external-graphic>
> <xsl:if test="ancestor::figure[role='bordered']">
> <xsl:attribute
name="border-color">black</xsl:attribute>

> <xsl:attribute
name="border-style">solid</xsl:attribute>

> </xsl:if>
> But what about HTML?
> 
> Thanks in advance!
> 
> Kind regards,
> Roman  
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection
around 
> http://mail.yahoo.com 
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-helplists.oasis-open.org


RE: selectively add a border to graphics
user name
2007-11-06 10:27:12
Roman Banks [mailto:technical_wryahoo.com] wrote:

>
Does anybody know how should I customize the graphics.xsl in order to selectively create a border around graphics in my HTML output? For PDF, it works nicely, but I can't find place in graphics.xsl to do the same thing for HTML.

 
We're currently using an older version of the style sheets, in which I can do something similar for HTML output by adding the following inside the <xsl:element> element of the "process.image" template:
 
<xsl:if test="ancestor::figure[role='bordered']">
 <xsl:attribute name="style">
&nbsp; &lt;xsl:text>border-style:solid;</xsl:text>
&nbsp;</xsl:attribute&gt;
</xsl:if>
 
It looks like the current templates are similar enough that this should still work, though to be thorough&nbsp;you might also want to remove the following&nbsp;line in the processing of non-scaled images:
 
<xsl:attribute name="border">0&lt;/xsl:attribute>
 
I'm not sure why that's there; it might be to turn off the automatic border that some browsers place ;around images that are links.
 
 
Rob Cavicchio
Senior Technical Writer
EMC Captiva
EMC Corporation
10145 Pacific Heights Boulevard, 6th Floor
San Diego, CA 92121-4234

P: (858) 320-1208
F: (858) 320-1010
E: Cavicchio_Robemc.com

The opinions expressed in this message are my own and should in no way be interpreted to reflect the opinions of EMC.
 
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )