This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Replacing images with alt tags - PART 2
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Jacob P. Glenn" <jpglenn2 at hotmail dot com>
- Cc: XSL-List at lists dot mulberrytech dot com
- Date: Fri, 19 Apr 2002 10:26:50 +0100
- Subject: Re: [xsl] Replacing images with alt tags - PART 2
- Organization: Jeni Tennison Consulting Ltd
- References: <002b01c1e72f$c9f2db60$e9aa1681@jackasskid>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Jacob,
> and I also tried:
>
> <xsl:template match='img'>
> <xsl:choose>
> <xsl:when test="ancestor::p">
> <xsl:value-of select="@alt"/>
> <xsl:apply-templates/>
> </xsl:when>
> <xsl:when test="parent::a">
> <xsl:value-of select="@alt"/>
> <xsl:apply-templates/>
> </xsl:when>
> <xsl:otherwise>
> <p>
> <xsl:value-of select="@alt"/>
> <xsl:apply-templates/>
> </p>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
>
> both times I still get nested <p> elements which is invalid wml and
> cannot be viewed by the browser.
>From the snippets that you've shown us and what you've described, this
doesn't seem like the behaviour I'd expect from an XSLT processor. Are
you sure that this is where the nested <p> elements are coming from?
Have you checked that the ancestor <p> elements are in no namespace
rather than the XHTML namespace?
If you post a full example that demonstrates the problem, we'll be
better able to help.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list