This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Replacing images with alt tags - PART 2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]