This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Replacing images with alt tags - PART 2
- From: "Jacob P. Glenn" <jpglenn2 at hotmail dot com>
- To: <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 18 Apr 2002 12:18:52 -0400
- Subject: [xsl] Replacing images with alt tags - PART 2
- Reply-to: xsl-list at lists dot mulberrytech dot com
So, even with breaking up the template the only one that works is the
"img" template. If an image is within a <p> tag it still uses the img
match thus putting <p> tags within <p> tags which is invalid wml. In
terms of images as the link of an <a> tag those are not converted.
Whats going on? I am new to this but I thought that the XSL was right.
<xsl:template match="a/img">
<!-- this should replace images with alt text only when img is the
link-->
<xsl:value-of select="@alt"/>
</xsl:template>
<xsl:template match="p/img">
<!-- replace images with alt text only when img is within a <p>-->
<xsl:value-of select="@alt"/>
</xsl:template>
<xsl:template match="img">
<!-- replace images with alt text in <p> tags when its not within
tags-->
<p><xsl:value-of select="@alt"/></p>
</xsl:template>
Jacob
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list