This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
attribute value replaced with <xsl:attribute/>?
- From: "jian" <jian at ariel-networks dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 22 Aug 2002 14:36:53 +0900
- Subject: [xsl] attribute value replaced with <xsl:attribute/>?
- References: <200208210630.CAA01959@biglist.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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