This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: website and dir


On Wed, Jan 15, 2003 at 06:15:14AM +0000, Dave Pawson wrote:
> At 22:08 14/01/2003 -0800, Bob Stayton wrote:
> 
> >Currently, no.   But this would make a fine feature request.
> 
> Hi Bob.
> What about the idea of a general graphics-path param?
> Then Kevin could simply use the graphics file name and
> the param value is prepended to that?
> 
> Sounds good to me.
> regards DaveP

That's one way to do it, but it requires an absolute
path value in the param, which would put absolute paths in
the HTML files.  I don't like putting absolute paths
in my HTML files.  Been burned too often ...

I did manage to test out a customization using
the root-rel-path template.  I copied the 
'mediaobject.filename' template from common/common.xsl
to my website customization layer, and changed the
top of it thusly:

<!-- new parameter; maybe could use a better name -->
<xsl:param name="root-rel-graphics">1</xsl:param>

<xsl:template name="mediaobject.filename">
  <xsl:param name="object"></xsl:param>

  <xsl:variable name="data" select="$object/videodata
                                    |$object/imagedata
                                    |$object/audiodata
                                    |$object"/>

  <xsl:variable name="filename">
<!-- start customization for root relative -->
    <xsl:if test="$root-rel-graphics != 0">
      <xsl:call-template name="root-rel-path"/>
    </xsl:if>
<!-- end customization for root relative -->
    <xsl:choose>
      <xsl:when test="$data[@fileref]">
       ...

This worked when I used fileref="graphics/foo.png".
It properly calculated a relative path as
src="../graphics/foo.png" when one directory down
or ../../graphics/foo.png when two directories down.

But I hate copying such a long and complicated template
to my customization layer, because there is good chance
it will change in some future release.  Hmm, what to do?

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]