[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSLT/CSS border style - setting length of dashes


Subject: Re: [xsl] XSLT/CSS border style - setting length of dashes
From: "Kevin Brown" <kevin@xxxxxxxxxxx>
Date: Sun, 22 Jul 2012 11:37:59 -0700

Ken is exactly right (of course).

As for your implementation, RenderX does not support the end user modifying
the length of dashes in borders. A snippet of our internal formats shows
this below (comments added for clarity) -- only color, style and thickness
can be specified for each border (you would note that a solid border to
RenderX consists of polygons so that the corners can be mitered together):

<!-- Set the color -->
<xep:gray-color gray="0.0"/>
<!-- Draw a dashed border -->
<xep:line style="dashed" thickness="1000" x-from="22677" y-from="561801"
x-till="112677" y-till="561801"/>
<!-- Draw a solid border -->
<xep:polygon x-from="112677" y-from="561801">
<xep:point x-till="113177" y-till="562301"/>
<xep:point x-till="328177" y-till="562301"/>
<xep:point x-till="328677" y-till="561801"/>
<xep:point x-till="329177" y-till="561301"/>
<xep:point x-till="112677" y-till="561301"/>
</xep:polygon>

That said, it would be a somewhat easy exercise to develop a custom
post-process of the above XEP intermediate file to obtain what you want. We
do such exercises all the time for customization of output. You would pass
XEP Intermediate Format to an application that replaces the above
<xep:line/> with a inline SVG that accomplishes what you desire. You have in
that one line almost all you need ... the line runs from 22677 to 112677 in
XEP units (1/1000th of a point) and is 1000 (1 pt) thick. You would only
need to also record the current color which would be the last color set
prior to the actual <xep:line/> (in this case gray="0.0" which is
essentially black).

The application could be a simple XMLReader/XMLWriter that grabs all
<xep:line/> elements and creates a small SVG with appropriate dash
lengths/spacing and the length specified and either writes to disk or Base64
encodes the image and puts it right back into the intermediate format using
the <xep:image/> element.

This is exactly how we accomplished things like rounded corners on any/all
corners of tables or rectangular area, gradient fills on text and many other
"tricks".

You can contact me directly if you are interested.

Kevin Brown
RenderX
kevin@xxxxxxxxxxx


Current Thread
Keywords
svg