This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: illegal xhtml attributes?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] illegal xhtml attributes?
- From: "Dominic Tocci" <dominic dot tocci at econovo dot com>
- Date: Mon, 2 Apr 2001 09:20:33 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hey thanks for the reply. I've dumbed down the xsl to the point where it's
small enough and I still get the warning. Here is the offending xsl. The
xml is in the attached message text below. I found when I take out the 5
lines beginning with "<xsl:if test="$reset='true'">", I don't get the
warning during my transformation anymore. Maybe I'm being dense but I don't
see what's wrong with the code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:out="output.xsl"
version="1.0">
<xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
<xsl:template match="xbutton">
<xsl:variable name="imagewidth" select="./image/@width"/>
<xsl:variable name="imageheight" select="./image/@height"/>
<xsl:variable name="imagealt" select="./image/@alt"/>
<out:variable name="image">
<xsl:apply-templates select="./image"/>
</out:variable>
<xsl:variable name="reset">
<xsl:text>true</xsl:text>
</xsl:variable>
<out:variable name="action">
<xsl:apply-templates select="./action"/>
</out:variable>
<a>
<xsl:attribute name="href">
<xsl:text>javascript:document.forms[</xsl:text>
<xsl:value-of
select="count(./preceding::*[name(.)='form']) +
count(./preceding::*[name(.)='xform'])"/>
<xsl:text>].reset();</xsl:text>
</xsl:attribute>
<img border="0">
<xsl:attribute name="width">
<xsl:value-of select="$imagewidth"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="$imageheight"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="$imagealt"/>
</xsl:attribute>
<out:attribute name="src">
<out:value-of select="$image"/>
</out:attribute>
<xsl:if test="$reset='true'">
<xsl:attribute name="alt">
<xsl:value-of select="'Reset'"/>
</xsl:attribute>
</xsl:if>
</img>
</a>
</xsl:template>
</xsl:stylesheet>
Thanks in advance for your help,
Dominic
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of cutlass
> Sent: Sunday, April 01, 2001 12:19 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] illegal xhtml attributes?
>
>
> > Hi,
> >
> > I'm perplexed. I have xml code which includes some xhtml code.
> When I try
> > to perform an xslt transformation on it, I get the following warning:
>
> nothing wrong with xml
>
> >
> > XSL Warning: Illegal attribute name: alt
> >
> > the xml code looks like this:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xbutton>
> > <image height="22" width="45" alt="Reset">images/gray.gif</image>
> > <clear/>
> > </xbutton>
> >
> > What's strange is that there is no adverse effect on my output, and the
> > error message tends to be intermittent. For example, this code does not
> > generate the same warning:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xbutton>
> > <image height="22" width="45" alt="Reset">images/gray.gif</image>
> > </xbutton>
>
> will help but need some example xsl.
>
> cheers, jim fuller
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list