  | |  | xsl behaviour | xsl behaviour 2003-03-19 - By Tim Cronin
given the following Stylesheet
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <FONT> <xsl:apply-templates select="/Properties/Group[@(protected)='Data Properties']/Datum[@(protected)='Font']/Font"/> <xsl:attribute name="color"><xsl:if test="Datum[@(protected)='QuantityShort']<0">Red</xsl:if></xsl:attribute> <xsl:value-of select="Datum[@(protected)='QuantityOnOrder']"/> </FONT> </xsl:template> <xsl:template match="Font"> <xsl:attribute name="face"><xsl:value-of select="@(protected)"/></xsl:attribute> <xsl:attribute name="color"><xsl:value-of select="@(protected)"/></xsl:attribute> <xsl:attribute name="style">font-size:<xsl:value-of select="@(protected)"/>; font-style:<xsl:value-of select="@(protected)"/>;font-weight:<xsl:value-of select="@(protected)"/>;</xsl:attribute> </xsl:template> </xsl:stylesheet>
I get a transformation warning saying that "Attribute color is outside of element" refering to this line: <xsl:attribute name="color"><xsl:if test="Datum[@(protected)='QuantityShort']<0">Red</xsl:if></xsl:attribute>
the problem is within the font section <FONT> <xsl:apply-templates select="/Properties/Group[@(protected)='Data Properties']/Datum[@(protected)='Font']/Font"/> <xsl:attribute name="color"><xsl:if test="Datum[@(protected)='QuantityShort']<0">Red</xsl:if></xsl:attribute> <xsl:value-of select="Datum[@(protected)='QuantityOnOrder']"/> </FONT>
under MS this worked OK... should I be able to do this?
|
|
 |