[xsl] Replacing images with alt tags - PART 2

Subject: [xsl] Replacing images with alt tags - PART 2
From: "Jacob P. Glenn" <jpglenn2@xxxxxxxxxxx>
Date: Thu, 18 Apr 2002 12:18:52 -0400
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


Current Thread