On Jul 15, 11:57*am, Martin Honnen <mahotr...@yahoo.de> wrote:
> T wrote:
> > Hi, I'm trying to get the alt text from this bit of docbook xml:
> > <inlineequation>
> > <inlinemediaobject remap="math">
> > <alt>$F$</alt>
> > <imageobject>
> > * <imagedata depth="0px"
> > * * * fileref="images/geneug_whatsnew0001.png"
> > * * * contentwidth="10px" contentdepth="10px" role="math" />
> > </imageobject>
> > </inlinemediaobject>
> > </inlineequation>
>
> > With this selector:
> > <xsl:template match="d:inlineequation/d:inlinemediaobject/
> > d:imageobject/d:imagedata[@depth]">
> > * <xsl:element name="img">
> > * * <xsl:attribute name="alt"><xsl:value-of select="../../alt"/></
> > xsl:attribute>
>
> The use of the 'd' prefix on the other elements suggests a namespace
> applies so you want
> * *../../d:alt
>
> Also note that your code is rather verbose, literal result elements and
> attribute value templates are shorter e.g.
> * *<img alt="{../../d:alt}" />
>
> --
>
> * * * * Martin Honnen
> * * * *http://msmvps.com/blogs/martin_honnen/
Hi Martin,
I am getting old and forgetful. Thanks for pointing out I had omitted
the namespace abbreviation. That was the problem of course...
Thanks also for the comment about the verbosity. I did not know I
could use such a simple syntax. The books I have on XSLt show the
verbose method, which is where I learned it. However, the stylesheet
fragment I posted is for creating HTML 4.0 instead of XHTML; I think
that means I must use the verbose method, correct? (since <img ... />
is illegal in HTML 4.)
thanks for your help,
--Tim Arnold