> > >
> > > The area of thinking I have at the moment is something like :-
> > >
> > > <xsl:when test="starts-with(string(@src),'../')">
> > > <xsl:value-of select="substring-after(string(@src),'../')"/>
> > > </xsl:when>
> > >
> >
> > That's where I was thinking, yes. I think you may find there is a
> > template for stripping dot dots in the existing dotdots stylesheet, not
> > sure though.
>
> No, just a template to convert paths into dotdots.
>
> I'll have a play and create one to remove dotdots.
>
> Gav...
Well I have had a play and this is what I have so far.
<xsl:template name="removedotdots">
<xsl:param name="path"/>
<xsl:variable name="removedirs" select="substring
after(string($path),'../')"/>
<xsl:variable name="removeagain"
select="starts-with(string($removedirs),'../')"/>
<xsl:if test="$removeagain">
<xsl:call-template name="removedotdots">
<xsl:with-param name="path"
select="substring-after(string($removedirs),'../')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
And the calling code :-
<xsl:otherwise>
<xsl:variable name="path" select="@src"/>
<xsl:call-template name="removedotdots">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:otherwise>
Unfortunately this does not work. Seems like I'm either not getting a
Value returned from the template, the return is empty for some reason, or
the @src value is not being passed into the template, don't know which.
I end up with fo output of
<fo:external-graphic src=""/>
So if someone spots a mistake or two let me know, I'll carry on tonight.
Gav...