Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
Defaulting empty attributes to nbsp
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Martin Honnen, post: 779503"] Here is an example how you could do it for the value attribute, you would then need to add code for the other attributes as well: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="[URL]http://www.w3.org/1999/XSL/Transform[/URL]" version="1.0"> <xsl:output method="html" /> <xsl:template match="commands"> <table> <tbody> <xsl:apply-templates select="command" /> </tbody> </table> </xsl:template> <xsl:template match="command"> <tr> <xsl:apply-templates select="key" /> </tr> </xsl:template> <xsl:template match="key"> <td> <xsl:choose> <xsl:when test="@value"> <xsl:value-of select="@value" /> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </td> </xsl:template> </xsl:stylesheet> Example result is <table> <tbody> <tr> <td>z</td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </tbody> </table> [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
Defaulting empty attributes to nbsp
Top