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

attribute value replaced with <xsl:attribute/>?

Subject: attribute value replaced with <xsl:attribute/>?
From: "jian" <jian@xxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Aug 2002 14:36:53 +0900
html xmlns xalan
hello list,

<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?

for example i have:

<?xml version='1.0' encoding='UTF-8' ?>
<xsl:stylesheet version='1.0' xmlns:xalan='http://xml.apache.org/xalan'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:output method="html" indent="yes" />

 <xsl:template match="/">
  <html>
   <body>
    <table border="1">
     <tr>
     <td class="jian">
      <xsl:attribute name="class">
       <xsl:text>sizaki</xsl:text>
      </xsl:attribute>
      <xsl:text>does it change?</xsl:text>
     </td>
     </tr>
    </table>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet>

and i get:

<html xmlns:xalan="http://xml.apache.org/xalan">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table border="1">
<tr>
<td class="sizaki">does it change?</td>
</tr>
</table>
</body>
</html>

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

thank you.

jian



 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.