[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Append Attribute
At 2004-11-13 07:18 -0800, Karl J. Stubsjoen wrote:
Using xsl:attribute (or similar), is there a way to append an attribute to an existing attribute set? No. Every time you define an attribute value it will replace any pending attribute value for the currently open set of specified attributes. I'm assuming when you say "attribute set" you are speaking of the open set of specified attributes and not the XSLT "attribute-set" construct. Example: <div class="my_div"> <xsl:attribute name="class">big_font</xsl:attribute> </div> Assuming that your <xsl:attribute/> is embedded in some testing logic (otherwise you would have explicitly added it), my recommendation would be to use the attribute instruction for all of the properties with the logic as follows (note the spacing inside the <xsl:text>): <div> <xsl:attribute name="class"> <xsl:text>my_div</xsl:text> <xsl:if test="$mytest"> <xsl:text> big_font</xsl:text> </xsl:if> <xsl:if test="$myothertest"> <xsl:text> other_property</xsl:text> </xsl:if> </xsl:attribute> ... </div> Since all attributes need to be added before any content, the above should not be disruptive to the flow of logic you would need if such a thing as an append existed ... which it does not. I hope this helps. .................... Ken -- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|