[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] attribute value replaced with <xsl:attribute/>?
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
|
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
|