XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Francisco MonteiroSubject: Any ideas why?
Author: Francisco Monteiro
Date: 31 Aug 2004 03:19 PM
I have this snippet

<xforms:output class="Label">
<xsl:variable name="bType">
<xsl:call-template name="getBalanceType">
<xsl:with-param name="elementName" select="@xlink:to" />
</xsl:call-template>
</xsl:variable>
<xsl:comment>
<xsl:value-of select="$bType" />
</xsl:comment>
<xsl:choose>

<xsl:when test="$bType = 'debit'">
<xsl:attribute name="style">width:300px; colour:red;</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">width:300px;</xsl:attribute>

</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="GetLabel">
<xsl:with-param name="id">
<xsl:value-of select="@xlink:to"/>
</xsl:with-param>
</xsl:call-template>
</xforms:output>

The resultant output is this

<xforms:output class="label">
<!--debit-->Tax Expense (Income) Attributable to Extraordinary Items of Income or Expense
</xforms:output>

Looks like the style attribute is not honoured?

Francisco

Postnext
Ivan PedruzziSubject: Any ideas why?
Author: Ivan Pedruzzi
Date: 31 Aug 2004 03:59 PM
Hi Francisco,

xsl:attribute element adds an attribute node to the containing result element node.
In this case is a comment node which doesn't support attributes so is ignored.

You have to move the xsl:comment after the choose block.

Hope this helps
Ivan


Posttop
Francisco MonteiroSubject: Any ideas why?
Author: Francisco Monteiro
Date: 31 Aug 2004 04:58 PM
Thanks, that did the trick

Francisco

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.