[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: attribute value replaced with <xsl:attribute/>?

Subject: RE: attribute value replaced with <xsl:attribute/>?
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 22 Aug 2002 08:50:12 +0300
change class value
Hi,

> <xsl:attribute name="smth"/>
> replaces the hardcoded original "@smth" attribute in an element like
> <el smth="*">
> is it ok? am i safe putting default values into
> <el>
> and when needed replace the value with
>     <xsl:if test="">
>         <xsl:attribute/>
>     </xsl:if>
> or should i put default stuff into
> <xsl:otherwise/>?
> i use xalan and i wonder if this behaviour common to all processors?

Umm... to tell you the truth, I don't quite understand the question, but if you're asking whether you should use xsl:if or xsl:choose to get what you want, that's a matter of taste.

> note that instead of
>     <td class="jian" class="sizaki">does it change?</td>
> i get:
>     <td class="sizaki">does it change?</td>

Yes, because xsl:attribute replaces the existing attribute. But still, you don't want to get two class attributes, as XML doesn't allow that. Instread try to write your XSLT stylesheet to generate

  <td class="jian sizaki">does it change?</td>

which is what you really should want.

Cheers,

Jarno

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.