You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Tim Cronin <ti...@13-colonies.com> on 2003/03/19 17:28:33 UTC
xsl behaviour
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[@Name='Data
Properties']/Datum[@Name='Font']/Font"/>
<xsl:attribute name="color"><xsl:if
test="Datum[@Name='QuantityShort']<0">Red</xsl:if></xsl:attribute>
<xsl:value-of select="Datum[@Name='QuantityOnOrder']"/>
</FONT>
</xsl:template>
<xsl:template match="Font">
<xsl:attribute name="face"><xsl:value-of
select="@Family"/></xsl:attribute>
<xsl:attribute name="color"><xsl:value-of
select="@Color"/></xsl:attribute>
<xsl:attribute name="style">font-size:<xsl:value-of select="@Size"/>;
font-style:<xsl:value-of select="@Style"/>;font-weight:<xsl:value-of
select="@Weight"/>;</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[@Name='QuantityShort']<0">Red</xsl:if></xsl:attribute>
the problem is within the font section
<FONT>
<xsl:apply-templates select="/Properties/Group[@Name='Data
Properties']/Datum[@Name='Font']/Font"/>
<xsl:attribute name="color"><xsl:if
test="Datum[@Name='QuantityShort']<0">Red</xsl:if></xsl:attribute>
<xsl:value-of select="Datum[@Name='QuantityOnOrder']"/>
</FONT>
under MS this worked OK...
should I be able to do this?