This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]